Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit b727e5b

Browse files
committed
fix missing/extragenous config properties by refactored tests
1 parent 949b4d6 commit b727e5b

13 files changed

+364
-112
lines changed

src/filenames.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module.exports = {
33
'filenames',
44
],
55
rules: {
6-
'filenames/match-exported': ['error', ['camel', 'pascal']],
7-
'filenames/match-regex': ['error', '^[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)*$'],
6+
'filenames/match-exported': ['error', ['camel', 'pascal'], null, null],
7+
'filenames/match-regex': ['error', '^[a-zA-Z0-9]+(\\.[a-zA-Z0-9]+)*$', false],
88
'filenames/no-index': 'off',
99
},
1010
};

src/flow.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module.exports = {
3131
'flowtype/require-inexact-type': 'off',
3232
'flowtype/require-parameter-type': ['error', {
3333
excludeArrowFunctions: 'expressionsOnly',
34+
excludeParameterMatch: 'a^',
3435
}],
3536
'flowtype/require-readonly-react-props': 'error',
3637
'flowtype/require-return-type': ['error', 'always', {
@@ -40,6 +41,7 @@ module.exports = {
4041
'flowtype/require-types-at-top': 'off',
4142
'flowtype/require-valid-file-annotation': ['error', 'always', {
4243
annotationStyle: 'line',
44+
strict: false,
4345
}],
4446
'flowtype/require-variable-type': 'off',
4547
'flowtype/semi': ['error', 'always'],

src/import.js

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,18 @@ module.exports = {
2323
'import/imports-first': 'off', // deprecated, alias for "first"
2424
'import/max-dependencies': 'off',
2525
'import/named': 'error',
26-
'import/namespace': 'error',
27-
'import/newline-after-import': 'error',
28-
'import/no-absolute-path': 'error',
26+
'import/namespace': ['error', {
27+
allowComputed: false,
28+
}],
29+
'import/newline-after-import': ['error', {
30+
count: 1,
31+
}],
32+
'import/no-absolute-path': ['error', {
33+
esmodule: true,
34+
commonjs: true,
35+
amd: false,
36+
ignore: undefined,
37+
}],
2938
'import/no-amd': 'error',
3039
'import/no-anonymous-default-export': ['error', {
3140
allowArray: true,
@@ -36,8 +45,17 @@ module.exports = {
3645
allowLiteral: false,
3746
allowObject: true,
3847
}],
39-
'import/no-commonjs': 'error',
40-
'import/no-cycle': 'error',
48+
'import/no-commonjs': ['error', {
49+
allowRequire: false,
50+
allowPrimitiveModules: false,
51+
}],
52+
'import/no-cycle': ['error', {
53+
maxDepth: Infinity,
54+
esmodule: true,
55+
commonjs: false,
56+
amd: false,
57+
ignore: undefined,
58+
}],
4159
'import/no-default-export': 'off',
4260
'import/no-deprecated': 'error',
4361
'import/no-duplicates': 'error',
@@ -46,8 +64,11 @@ module.exports = {
4664
devDependencies: ['**/tests/**/*'], // do not report dev dependencies in tests
4765
optionalDependencies: true, // do not report optional dependencies
4866
peerDependencies: true, // do not report peer dependencies
67+
packageDir: undefined,
68+
}],
69+
'import/no-internal-modules': ['error', {
70+
allow: undefined,
4971
}],
50-
'import/no-internal-modules': 'error',
5172
'import/no-mutable-exports': 'error',
5273
'import/no-named-as-default': 'error',
5374
'import/no-named-as-default-member': 'error',
@@ -60,8 +81,17 @@ module.exports = {
6081
'import/no-self-import': 'error',
6182
'import/no-unassigned-import': ['error', {
6283
allow: ['**/*.css', '*polyfill*'],
84+
devDependencies: undefined, // in schema, but not in code
85+
optionalDependencies: undefined, // in schema, but not in code
86+
peerDependencies: undefined, // in schema, but not in code
87+
}],
88+
'import/no-unresolved': ['error', {
89+
caseSensitive: true,
90+
esmodule: true,
91+
commonjs: false,
92+
amd: false,
93+
ignore: undefined,
6394
}],
64-
'import/no-unresolved': 'error',
6595
'import/no-unused-modules': ['error', {
6696
missingExports: false,
6797
unusedExports: true,
@@ -70,6 +100,13 @@ module.exports = {
70100
}],
71101
'import/no-useless-path-segments': ['error', {
72102
noUselessIndex: true,
103+
commonjs: false,
104+
105+
/*
106+
* esmodule: true, // in code, but not in schema
107+
* amd: false, // in code, but not in schema
108+
* ignore: undefined, // in code, but not in schema
109+
*/
73110
}],
74111
'import/no-webpack-loader-syntax': 'off',
75112
'import/order': 'off',

src/native.js

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,26 @@ module.exports = {
44
rules: {
55
'accessor-pairs': 'off',
66
'array-bracket-newline': ['error', 'consistent'],
7-
'array-bracket-spacing': ['error', 'never'],
7+
'array-bracket-spacing': ['error', 'never', {
8+
singleValue: false,
9+
objectsInArrays: false,
10+
arraysInArrays: false,
11+
}],
812
'array-callback-return': 'error',
913
'array-element-newline': ['error', 'consistent'],
1014
'arrow-body-style': 'off',
11-
'arrow-parens': ['error', 'always'],
15+
'arrow-parens': ['error', 'always', {}],
1216
'arrow-spacing': 'error',
1317
'block-scoped-var': 'error',
1418
'block-spacing': 'error',
15-
'brace-style': ['error', '1tbs'],
19+
'brace-style': ['error', '1tbs', {
20+
allowSingleLine: false,
21+
}],
1622
'callback-return': 'off',
1723
'camelcase': ['error', {
1824
properties: 'never',
25+
ignoreDestructuring: false,
26+
allow: undefined,
1927
}],
2028
'capitalized-comments': 'off',
2129
'class-methods-use-this': 'off',
@@ -60,6 +68,26 @@ module.exports = {
6068
'implicit-arrow-linebreak': 'error',
6169
'indent': ['error', 'tab', {
6270
SwitchCase: 1,
71+
VariableDeclarator: 1,
72+
outerIIFEBody: 1,
73+
MemberExpression: 1,
74+
FunctionDeclaration: {
75+
parameters: 1,
76+
body: 1,
77+
},
78+
FunctionExpression: {
79+
parameters: 1,
80+
body: 1,
81+
},
82+
CallExpression: {
83+
arguments: 1,
84+
},
85+
ArrayExpression: 1,
86+
ObjectExpression: 1,
87+
ImportDeclaration: 1,
88+
flatTernaryExpressions: false,
89+
ignoredNodes: [],
90+
ignoreComments: false,
6391
}],
6492
'init-declarations': 'error',
6593
'jsx-quotes': 'off',
@@ -71,10 +99,14 @@ module.exports = {
7199
beforeLineComment: false,
72100
allowBlockStart: true,
73101
allowBlockEnd: true,
102+
allowClassStart: true,
103+
allowClassEnd: true,
74104
allowObjectStart: true,
75105
allowObjectEnd: true,
76106
allowArrayStart: true,
77107
allowArrayEnd: true,
108+
ignorePattern: 'a^',
109+
applyDefaultIgnorePatterns: true,
78110
}],
79111
'lines-between-class-members': ['error', 'always', {
80112
exceptAfterSingleLine: true,
@@ -95,7 +127,13 @@ module.exports = {
95127
'multiline-comment-style': 'error',
96128
'multiline-ternary': 'off',
97129
'new-cap': ['error', {
130+
newIsCap: true,
98131
capIsNew: false,
132+
newIsCapExceptions: [],
133+
newIsCapExceptionPattern: 'a^',
134+
capIsNewExceptions: [],
135+
capIsNewExceptionPattern: 'a^',
136+
properties: true,
99137
}],
100138
'new-parens': 'error',
101139
'newline-per-chained-call': 'error',
@@ -225,6 +263,7 @@ module.exports = {
225263
'no-undef-init': 'error',
226264
'no-undefined': 'off',
227265
'no-underscore-dangle': ['error', {
266+
allow: undefined,
228267
allowAfterThis: true,
229268
allowAfterSuper: false,
230269
enforceInMethodNames: false,
@@ -235,7 +274,11 @@ module.exports = {
235274
'no-unreachable': 'error',
236275
'no-unsafe-finally': 'error',
237276
'no-unsafe-negation': 'error',
238-
'no-unused-expressions': 'error',
277+
'no-unused-expressions': ['error', {
278+
allowShortCircuit: false,
279+
allowTernary: false,
280+
allowTaggedTemplates: false,
281+
}],
239282
'no-unused-labels': 'error',
240283
'no-unused-vars': 'error',
241284
'no-use-before-define': 'error', // needs to be tested how it behaves in recursive call
@@ -254,24 +297,31 @@ module.exports = {
254297
'no-with': 'error',
255298
'nonblock-statement-body-position': 'off',
256299
'object-curly-newline': ['error', {
257-
ObjectExpression: {multiline: true, consistent: true},
258-
ObjectPattern: {multiline: true, consistent: true},
259-
ImportDeclaration: {multiline: true, consistent: true},
260-
ExportDeclaration: {multiline: true, consistent: true},
300+
ObjectExpression: {multiline: true, consistent: true, minProperties: Number.POSITIVE_INFINITY},
301+
ObjectPattern: {multiline: true, consistent: true, minProperties: Number.POSITIVE_INFINITY},
302+
ImportDeclaration: {multiline: true, consistent: true, minProperties: Number.POSITIVE_INFINITY},
303+
ExportDeclaration: {multiline: true, consistent: true, minProperties: Number.POSITIVE_INFINITY},
304+
}],
305+
'object-curly-spacing': ['error', 'never', {
306+
arraysInObjects: true,
307+
objectsInObjects: true,
261308
}],
262-
'object-curly-spacing': ['error', 'never'],
263309
'object-property-newline': ['error', {
264310
allowAllPropertiesOnSameLine: true,
265311
}],
266312
'object-shorthand': ['error', 'consistent'],
267313
'one-var': ['error', 'never'],
268314
'one-var-declaration-per-line': 'error',
269315
'operator-assignment': ['error', 'never'],
270-
'operator-linebreak': ['error', 'before'],
316+
'operator-linebreak': ['error', 'before', {
317+
overrides: {},
318+
}],
271319
'padded-blocks': ['error', {
272320
classes: 'never',
273321
blocks: 'never',
274322
switches: 'never',
323+
}, {
324+
allowSingleLineBlocks: false,
275325
}],
276326
'padding-line-between-statements': [
277327
'error',
@@ -299,6 +349,7 @@ module.exports = {
299349
'quote-props': ['error', 'consistent-as-needed'],
300350
'quotes': ['error', 'single', {
301351
avoidEscape: true,
352+
allowTemplateLiterals: true,
302353
}],
303354
'radix': 'error',
304355
'require-atomic-updates': 'error',
@@ -330,10 +381,13 @@ module.exports = {
330381
'unicode-bom': 'error',
331382
'use-isnan': ['error', {
332383
enforceForSwitchCase: true,
384+
enforceForIndexOf: true,
333385
}],
334386
'valid-typeof': 'error',
335387
'vars-on-top': 'off',
336-
'wrap-iife': ['error', 'inside'],
388+
'wrap-iife': ['error', 'inside', {
389+
functionPrototypeMethods: false,
390+
}],
337391
'wrap-regex': 'off',
338392
'yield-star-spacing': ['error', 'before'],
339393
'yoda': 'error',

src/sortImportsES6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module.exports = {
55
rules: {
66
'sort-imports-es6-autofix/sort-imports-es6': ['error', {
77
ignoreCase: false,
8-
ignoreDeclarationSort: false,
98
ignoreMemberSort: false,
109
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
10+
typeSortStrategy: 'after',
1111
}],
1212
},
1313
};

src/typescript.js

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
'@typescript-eslint/adjacent-overload-signatures': 'error',
2525
'@typescript-eslint/array-type': ['error', {
2626
default: 'array-simple',
27+
readonly: 'array-simple',
2728
}],
2829
'@typescript-eslint/await-thenable': 'error',
2930
'@typescript-eslint/ban-ts-ignore': 'off',
@@ -55,23 +56,49 @@ module.exports = {
5556
},
5657
}],
5758
'brace-style': 'off',
58-
'@typescript-eslint/brace-style': ['error', '1tbs'],
59+
'@typescript-eslint/brace-style': ['error', '1tbs', {
60+
allowSingleLine: false,
61+
}],
5962
'@typescript-eslint/camelcase': 'off', // Used in general eslint rules,
6063
'@typescript-eslint/class-name-casing': 'error',
6164
'@typescript-eslint/consistent-type-assertions': ['error', {
6265
assertionStyle: 'as',
6366
objectLiteralTypeAssertions: 'never',
6467
}],
6568
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
66-
'@typescript-eslint/explicit-function-return-type': ['error', {allowExpressions: true}],
69+
'@typescript-eslint/explicit-function-return-type': ['error', {
70+
allowExpressions: true,
71+
allowTypedFunctionExpressions: true,
72+
allowHigherOrderFunctions: true,
73+
allowDirectConstAssertionInArrowFunctions: true,
74+
}],
6775
'@typescript-eslint/explicit-member-accessibility': 'error',
6876
'func-call-spacing': 'off', // Disable base rule to avoid errors
6977
'@typescript-eslint/func-call-spacing': 'error',
7078
'@typescript-eslint/generic-type-naming': 'off',
7179
'indent': 'off', // Disable base rule to avoid errors
7280
'@typescript-eslint/indent': ['error', 'tab', {
7381
SwitchCase: 1,
82+
VariableDeclarator: 1,
83+
outerIIFEBody: 1,
7484
MemberExpression: 1,
85+
FunctionDeclaration: {
86+
parameters: 1,
87+
body: 1,
88+
},
89+
FunctionExpression: {
90+
parameters: 1,
91+
body: 1,
92+
},
93+
CallExpression: {
94+
arguments: 1,
95+
},
96+
ArrayExpression: 1,
97+
ObjectExpression: 1,
98+
ImportDeclaration: 1,
99+
flatTernaryExpressions: false,
100+
ignoredNodes: undefined,
101+
ignoreComments: false,
75102
}],
76103
'@typescript-eslint/interface-name-prefix': 'off',
77104
'@typescript-eslint/member-delimiter-style': 'error',
@@ -89,7 +116,9 @@ module.exports = {
89116
}],
90117
'@typescript-eslint/no-extra-parens': 'off',
91118
'@typescript-eslint/no-extraneous-class': 'error',
92-
'@typescript-eslint/no-floating-promises': 'error',
119+
'@typescript-eslint/no-floating-promises': ['error', {
120+
ignoreVoid: false,
121+
}],
93122
'@typescript-eslint/no-for-in-array': 'error',
94123
'@typescript-eslint/no-inferrable-types': 'off',
95124
'@typescript-eslint/no-magic-numbers': 'off',
@@ -118,6 +147,7 @@ module.exports = {
118147
allowCallbacks: 'always',
119148
allowLiterals: 'always',
120149
allowMappedTypes: 'always',
150+
allowTupleTypes: 'always',
121151
}],
122152
'@typescript-eslint/no-unnecessary-qualifier': 'error',
123153
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
@@ -138,6 +168,7 @@ module.exports = {
138168
'quotes': 'off',
139169
'@typescript-eslint/quotes': ['error', 'single', {
140170
avoidEscape: true,
171+
allowTemplateLiterals: true,
141172
}],
142173
'@typescript-eslint/require-array-sort-compare': 'off',
143174
'require-await': 'off',
@@ -146,6 +177,7 @@ module.exports = {
146177
'semi': 'off', // Disable base rule to avoid errors
147178
'@typescript-eslint/semi': 'error',
148179
'@typescript-eslint/strict-boolean-expressions': ['error', {
180+
allowNullable: false,
149181
ignoreRhs: false,
150182
}],
151183
'@typescript-eslint/triple-slash-reference': ['error', {

0 commit comments

Comments
 (0)