Skip to content

Commit 916705a

Browse files
authored
Merge pull request #510 from share/eslintignore
🚨 Ignore docs when linting
2 parents 8263263 + fb1e7da commit 916705a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.eslintrc.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
22
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
33
// rules, we have to turn them off ourselves.
4-
const DISABLED_ES6_OPTIONS = {
4+
var DISABLED_ES6_OPTIONS = {
55
'no-var': 'off',
66
'prefer-rest-params': 'off'
77
};
88

9-
const SHAREDB_RULES = {
9+
var SHAREDB_RULES = {
1010
// Comma dangle is not supported in ES3
1111
'comma-dangle': ['error', 'never'],
1212
// We control our own objects and prototypes, so no need for this check
1313
'guard-for-in': 'off',
1414
// Google prescribes different indents for different cases. Let's just use 2 spaces everywhere. Note that we have
1515
// to override ESLint's default of 0 indents for this.
16-
'indent': ['error', 2, {
17-
'SwitchCase': 1
16+
indent: ['error', 2, {
17+
SwitchCase: 1
1818
}],
1919
// Less aggressive line length than Google, which is especially useful when we have a lot of callbacks in our code
2020
'max-len': ['error',
2121
{
2222
code: 120,
2323
tabWidth: 2,
24-
ignoreUrls: true,
24+
ignoreUrls: true
2525
}
2626
],
27-
// Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused variables
27+
// Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused
28+
// variables
2829
'no-unused-vars': ['error', {vars: 'all', args: 'after-used'}],
2930
// It's more readable to ensure we only have one statement per line
3031
'max-statements-per-line': ['error', {max: 1}],
@@ -46,4 +47,7 @@ module.exports = {
4647
DISABLED_ES6_OPTIONS,
4748
SHAREDB_RULES
4849
),
50+
ignorePatterns: [
51+
'/docs/'
52+
]
4953
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"devDependencies": {
1414
"chai": "^4.2.0",
1515
"coveralls": "^3.0.7",
16-
"eslint": "^6.5.1",
16+
"eslint": "^7.32.0",
1717
"eslint-config-google": "^0.14.0",
18-
"ot-json0-v2": "ottypes/json0",
1918
"lolex": "^5.1.1",
2019
"mocha": "^8.2.1",
2120
"nyc": "^14.1.1",
21+
"ot-json0-v2": "ottypes/json0",
2222
"ot-json1": "^0.3.0",
2323
"sharedb-legacy": "npm:sharedb@=1.1.0",
2424
"sinon": "^7.5.0"

0 commit comments

Comments
 (0)