Skip to content

Commit 2bd13b2

Browse files
committed
style: fix lint errors in rules
1 parent a43b759 commit 2bd13b2

File tree

7 files changed

+62
-48
lines changed

7 files changed

+62
-48
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"rules"
99
],
1010
"scripts": {
11-
"prelint": "editorconfig-tools check * rules/* test/*",
12-
"lint": "eslint .",
11+
"config": "editorconfig-tools check * rules/* test/*",
12+
"lint": "eslint rules/* test/*",
1313
"release": "standard-version"
1414
},
1515
"dependencies": {},
1616
"devDependencies": {
1717
"editorconfig-tools": "^0.1.1",
1818
"eslint": "^3.13.0",
1919
"eslint-find-rules": "^1.14.3",
20+
"eslint-plugin-import": "^2.2.0",
2021
"standard-version": "^4.0.0"
2122
},
2223
"peerDependencies": {

rules/best-practices.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
'consistent-return': 'error',
2828

2929
// enforce consistent brace style for all control statements
30-
// http://eslint.org/docs/rules/curly
30+
// http://eslint.org/docs/rules/curly
3131
curly: ['error', 'multi-line'],
3232

3333
// require default cases in switch statements
@@ -77,7 +77,7 @@ module.exports = {
7777
'arrowFunctions',
7878
'functions',
7979
'methods',
80-
]
80+
],
8181
}],
8282

8383
// disallow empty destructuring patterns
@@ -313,6 +313,6 @@ module.exports = {
313313

314314
// require or disallow “Yoda” conditions
315315
// http://eslint.org/docs/rules/yoda
316-
yoda: 'error'
317-
}
316+
yoda: 'error',
317+
},
318318
};

rules/es2015.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
22
env: {
3-
es6: true
3+
es6: true,
44
},
55
parserOptions: {
66
ecmaVersion: 6,
77
sourceType: 'module',
88
ecmaFeatures: {
99
generators: false,
10-
objectLiteralDuplicateProperties: false
11-
}
10+
objectLiteralDuplicateProperties: false,
11+
},
1212
},
1313

1414
rules: {
@@ -28,7 +28,7 @@ module.exports = {
2828
// http://eslint.org/docs/rules/arrow-spacing
2929
'arrow-spacing': ['error', {
3030
before: true,
31-
after: true
31+
after: true,
3232
}],
3333

3434
// require super() calls in constructors
@@ -39,7 +39,7 @@ module.exports = {
3939
// http://eslint.org/docs/rules/generator-star-spacing
4040
'generator-star-spacing': ['error', {
4141
before: false,
42-
after: true
42+
after: true,
4343
}],
4444

4545
// disallow reassigning class members
@@ -168,6 +168,6 @@ module.exports = {
168168

169169
// require or disallow spacing around the * in yield* expressions
170170
// http://eslint.org/docs/rules/yield-star-spacing
171-
'yield-star-spacing': ['error', 'after']
172-
}
171+
'yield-star-spacing': ['error', 'after'],
172+
},
173173
};

rules/imports.js

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
module.exports = {
22
env: {
3-
es6: true
3+
es6: true,
44
},
55
parserOptions: {
66
ecmaVersion: 6,
7-
sourceType: 'module'
7+
sourceType: 'module',
88
},
99
plugins: [
10-
'import'
10+
'import',
1111
],
1212

1313
settings: {
1414
'import/resolver': {
1515
node: {
16-
extensions: ['.js', '.json']
17-
}
16+
extensions: ['.js', '.json'],
17+
},
1818
},
1919
'import/extensions': [
2020
'.js',
@@ -69,19 +69,32 @@ module.exports = {
6969
// paths are treated both as absolute paths, and relative to process.cwd()
7070
'import/no-extraneous-dependencies': ['error', {
7171
devDependencies: [
72-
'test/**', // tape, common npm pattern
73-
'tests/**', // also common npm pattern
74-
'spec/**', // mocha, rspec-like pattern
75-
'**/__tests__/**', // jest pattern
76-
'test.js', // repos with a single test file
77-
'test-*.js', // repos with multiple top-level test files
78-
'**/*.test.js', // tests where the extension denotes that it is a test
79-
'**/webpack.config.js', // webpack config
80-
'**/webpack.config.*.js', // webpack config
81-
'**/rollup.config.js', // rollup config
82-
'**/gulpfile.js', // gulp config
83-
'**/gulpfile.*.js', // gulp config
84-
'**/Gruntfile', // grunt config
72+
// tape, common npm pattern
73+
'test/**',
74+
// also common npm pattern
75+
'tests/**',
76+
// mocha, rspec-like pattern
77+
'spec/**',
78+
// jest pattern
79+
'**/__tests__/**',
80+
// repos with a single test file
81+
'test.js',
82+
// repos with multiple top-level test files
83+
'test-*.js',
84+
// tests where the extension denotes that it is a test
85+
'**/*.test.js',
86+
// webpack config
87+
'**/webpack.config.js',
88+
// webpack config
89+
'**/webpack.config.*.js',
90+
// rollup config
91+
'**/rollup.config.js',
92+
// gulp config
93+
'**/gulpfile.js',
94+
// gulp config
95+
'**/gulpfile.*.js',
96+
// grunt config
97+
'**/Gruntfile',
8598
],
8699
optionalDependencies: false,
87100
}],

rules/node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
env: {
33
node: true,
44
jest: true,
5-
mocha: true
5+
mocha: true,
66
},
77

88
rules: {
@@ -45,5 +45,5 @@ module.exports = {
4545
// disallow synchronous methods
4646
// http://eslint.org/docs/rules/no-sync
4747
'no-sync': 'off',
48-
}
48+
},
4949
};

rules/possible-errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ module.exports = {
127127
// enforce comparing typeof expressions against valid strings
128128
// http://eslint.org/docs/rules/valid-typeof
129129
'valid-typeof': ['error', { requireStringLiterals: true }],
130-
}
130+
},
131131
};

rules/stylistic-issues.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = {
6868
// require function names to match the name of the variable or property to which they are assigned
6969
// http://eslint.org/docs/rules/func-name-matching
7070
'func-name-matching': ['off', 'always', {
71-
includeCommonJSModuleExports: false
71+
includeCommonJSModuleExports: false,
7272
}],
7373

7474
// require or disallow named function expressions
@@ -99,12 +99,12 @@ module.exports = {
9999
outerIIFEBody: 1,
100100
FunctionDeclaration: {
101101
parameters: 1,
102-
body: 1
102+
body: 1,
103103
},
104104
FunctionExpression: {
105105
parameters: 1,
106-
body: 1
107-
}
106+
body: 1,
107+
},
108108
}],
109109

110110
// enforce the consistent use of either double or single quotes in JSX attributes
@@ -123,8 +123,8 @@ module.exports = {
123123
overrides: {
124124
return: { after: true },
125125
throw: { after: true },
126-
case: { after: true }
127-
}
126+
case: { after: true },
127+
},
128128
}],
129129

130130
// enforce position of line comments
@@ -169,7 +169,7 @@ module.exports = {
169169
'max-lines': ['off', {
170170
max: 300,
171171
skipBlankLines: true,
172-
skipComments: true
172+
skipComments: true,
173173
}],
174174

175175
// enforce a maximum depth that callbacks can be nested
@@ -245,9 +245,9 @@ module.exports = {
245245
['&', '|', '^', '~', '<<', '>>', '>>>'],
246246
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
247247
['&&', '||'],
248-
['in', 'instanceof']
248+
['in', 'instanceof'],
249249
],
250-
allowSamePrecedence: false
250+
allowSamePrecedence: false,
251251
}],
252252

253253
// disallow mixed spaces and tabs for indentation
@@ -314,7 +314,7 @@ module.exports = {
314314
// http://eslint.org/docs/rules/object-curly-newline
315315
'object-curly-newline': ['off', {
316316
ObjectExpression: { minProperties: 0, multiline: true },
317-
ObjectPattern: { minProperties: 0, multiline: true }
317+
ObjectPattern: { minProperties: 0, multiline: true },
318318
}],
319319

320320
// require padding inside curly braces
@@ -384,7 +384,7 @@ module.exports = {
384384
'space-before-function-paren': ['error', {
385385
anonymous: 'always',
386386
named: 'never',
387-
asyncArrow: 'always'
387+
asyncArrow: 'always',
388388
}],
389389

390390
// enforce consistent spacing inside parentheses
@@ -415,7 +415,7 @@ module.exports = {
415415
exceptions: ['-', '+'],
416416
markers: ['=', '!'],
417417
balanced: false,
418-
}
418+
},
419419
}],
420420

421421
// require or disallow Unicode byte order mark (BOM)
@@ -424,6 +424,6 @@ module.exports = {
424424

425425
// require parenthesis around regex literals
426426
// http://eslint.org/docs/rules/wrap-regex
427-
'wrap-regex': 'off'
428-
}
427+
'wrap-regex': 'off',
428+
},
429429
};

0 commit comments

Comments
 (0)