@fullstacksjs/eslint-config 14.8.0 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -20
- package/dist/index.mjs +1894 -0
- package/package.json +44 -46
- package/src/index.mjs +5 -5
- package/src/modules/base.mjs +10 -2
- package/src/modules/cypress.mjs +1 -0
- package/src/modules/imports.mjs +1 -0
- package/src/modules/jest.mjs +1 -0
- package/src/modules/next.mjs +1 -0
- package/src/modules/node.mjs +3 -0
- package/src/modules/perfectionist.mjs +1 -0
- package/src/modules/playwright.mjs +1 -0
- package/src/modules/prettier.mjs +1 -0
- package/src/modules/promise.mjs +1 -0
- package/src/modules/react.mjs +2 -0
- package/src/modules/regex.mjs +1 -0
- package/src/modules/storybook.mjs +1 -0
- package/src/modules/stylistic.mjs +1 -0
- package/src/modules/tailwind.mjs +1 -0
- package/src/modules/tests.mjs +4 -1
- package/src/modules/typescript.mjs +22 -4
- package/src/modules/vitest.mjs +1 -0
- package/src/utils/nextAllowExportNames.mjs +7 -0
- package/cjs/index.js +0 -137
- package/cjs/modules/base.js +0 -233
- package/cjs/modules/cypress.js +0 -39
- package/cjs/modules/ignore.js +0 -26
- package/cjs/modules/imports.js +0 -124
- package/cjs/modules/jest.js +0 -102
- package/cjs/modules/next.js +0 -48
- package/cjs/modules/node.js +0 -76
- package/cjs/modules/perfectionist.js +0 -54
- package/cjs/modules/playwright.js +0 -89
- package/cjs/modules/prettier.js +0 -97
- package/cjs/modules/promise.js +0 -45
- package/cjs/modules/react.js +0 -190
- package/cjs/modules/regex.js +0 -122
- package/cjs/modules/storybook.js +0 -49
- package/cjs/modules/stylistic.js +0 -94
- package/cjs/modules/tailwind.js +0 -56
- package/cjs/modules/tests.js +0 -52
- package/cjs/modules/typescript.js +0 -277
- package/cjs/modules/vitest.js +0 -116
- package/cjs/types/index.d.ts +0 -143
- package/cjs/types/modules/import.d.ts +0 -7
- package/cjs/types/modules/react.d.ts +0 -10
- package/cjs/types/modules/regex.d.ts +0 -5
- package/cjs/types/modules/tailwind.d.ts +0 -13
- package/cjs/types/modules/typescript.d.ts +0 -38
- package/cjs/utils/conditions.js +0 -25
- package/cjs/utils/getGitignorePatterns.js +0 -35
- package/cjs/utils/globs.js +0 -37
- package/cjs/utils/naming-convention.js +0 -63
- package/cjs/utils/nextAllowExportNames.js +0 -7
- package/cjs/utils/objectOrEmpty.js +0 -14
package/cjs/modules/base.js
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
8
|
-
var _globals = _interopRequireDefault(require("globals"));
|
|
9
|
-
var _conditions = require("../utils/conditions.js");
|
|
10
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* @param { import('../types').Options } options
|
|
14
|
-
* @return { import('eslint').Linter.Config }
|
|
15
|
-
*/
|
|
16
|
-
function base(options = {}) {
|
|
17
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.base.overrides);
|
|
18
|
-
const baseConfig = {
|
|
19
|
-
name: 'base',
|
|
20
|
-
languageOptions: {
|
|
21
|
-
ecmaVersion: 'latest',
|
|
22
|
-
sourceType: 'module',
|
|
23
|
-
globals: {
|
|
24
|
-
..._globals.default.browser,
|
|
25
|
-
..._globals.default.node,
|
|
26
|
-
..._globals.default.es2025
|
|
27
|
-
},
|
|
28
|
-
parserOptions: {
|
|
29
|
-
ecmaVersion: 'latest',
|
|
30
|
-
ecmaFeatures: {
|
|
31
|
-
jsx: true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
rules: {
|
|
36
|
-
'accessor-pairs': 'error',
|
|
37
|
-
'array-callback-return': 'error',
|
|
38
|
-
'block-scoped-var': 'error',
|
|
39
|
-
'camelcase': ['warn', {
|
|
40
|
-
properties: 'always'
|
|
41
|
-
}],
|
|
42
|
-
'complexity': ['error', 14],
|
|
43
|
-
'constructor-super': 'error',
|
|
44
|
-
'default-case-last': 'error',
|
|
45
|
-
'default-case': 'error',
|
|
46
|
-
'default-param-last': 'warn',
|
|
47
|
-
'dot-notation': 'error',
|
|
48
|
-
'eqeqeq': ['error', 'smart'],
|
|
49
|
-
'for-direction': 'error',
|
|
50
|
-
'func-name-matching': 'error',
|
|
51
|
-
'func-names': 'error',
|
|
52
|
-
'getter-return': ['error', {
|
|
53
|
-
allowImplicit: true
|
|
54
|
-
}],
|
|
55
|
-
'guard-for-in': 'error',
|
|
56
|
-
'max-depth': ['error', 4],
|
|
57
|
-
'max-lines-per-function': ['error', 150],
|
|
58
|
-
'max-lines': ['error', {
|
|
59
|
-
max: 2500,
|
|
60
|
-
skipBlankLines: false,
|
|
61
|
-
skipComments: false
|
|
62
|
-
}],
|
|
63
|
-
'max-nested-callbacks': ['error', 7],
|
|
64
|
-
'max-params': ['error', 3],
|
|
65
|
-
'max-statements': ['error', 40],
|
|
66
|
-
'no-alert': 'error',
|
|
67
|
-
'no-array-constructor': 'error',
|
|
68
|
-
'no-await-in-loop': 'error',
|
|
69
|
-
'no-bitwise': 'error',
|
|
70
|
-
'no-caller': 'error',
|
|
71
|
-
'no-case-declarations': 'error',
|
|
72
|
-
'no-class-assign': 'error',
|
|
73
|
-
'no-compare-neg-zero': 'error',
|
|
74
|
-
'no-cond-assign': 'error',
|
|
75
|
-
'no-const-assign': 'error',
|
|
76
|
-
'no-constant-binary-expression': 'warn',
|
|
77
|
-
'no-constant-condition': 'error',
|
|
78
|
-
'no-constructor-return': 'error',
|
|
79
|
-
'no-control-regex': 'error',
|
|
80
|
-
'no-debugger': 'error',
|
|
81
|
-
'no-delete-var': 'error',
|
|
82
|
-
'no-div-regex': 'error',
|
|
83
|
-
'no-dupe-args': 'error',
|
|
84
|
-
'no-dupe-class-members': 'error',
|
|
85
|
-
'no-dupe-else-if': 'error',
|
|
86
|
-
'no-dupe-keys': 'error',
|
|
87
|
-
'no-duplicate-case': 'error',
|
|
88
|
-
'no-duplicate-imports': 'error',
|
|
89
|
-
'no-empty-character-class': 'error',
|
|
90
|
-
'no-empty-function': 'warn',
|
|
91
|
-
'no-empty-pattern': 'error',
|
|
92
|
-
'no-empty-static-block': 'warn',
|
|
93
|
-
'no-empty': 'error',
|
|
94
|
-
'no-eval': 'error',
|
|
95
|
-
'no-ex-assign': 'error',
|
|
96
|
-
'no-extend-native': 'error',
|
|
97
|
-
'no-extra-bind': 'error',
|
|
98
|
-
'no-extra-label': 'error',
|
|
99
|
-
'no-fallthrough': 'error',
|
|
100
|
-
'no-func-assign': 'error',
|
|
101
|
-
'no-global-assign': 'error',
|
|
102
|
-
'no-implicit-globals': 'error',
|
|
103
|
-
'no-implied-eval': 'error',
|
|
104
|
-
'no-import-assign': 'error',
|
|
105
|
-
'no-inner-declarations': 'error',
|
|
106
|
-
'no-invalid-regexp': 'error',
|
|
107
|
-
'no-invalid-this': 'warn',
|
|
108
|
-
'no-irregular-whitespace': 'error',
|
|
109
|
-
'no-iterator': 'error',
|
|
110
|
-
'no-label-var': 'error',
|
|
111
|
-
'no-labels': 'error',
|
|
112
|
-
'no-lone-blocks': 'error',
|
|
113
|
-
'no-lonely-if': 'error',
|
|
114
|
-
'no-loop-func': 'error',
|
|
115
|
-
'no-loss-of-precision': 'warn',
|
|
116
|
-
'no-misleading-character-class': ['error', {
|
|
117
|
-
allowEscape: true
|
|
118
|
-
}],
|
|
119
|
-
'no-multi-assign': 'error',
|
|
120
|
-
'no-multi-str': 'error',
|
|
121
|
-
'no-new-func': 'error',
|
|
122
|
-
'no-new-native-nonconstructor': 'error',
|
|
123
|
-
'no-new-wrappers': 'error',
|
|
124
|
-
'no-new': 'error',
|
|
125
|
-
'no-nonoctal-decimal-escape': 'error',
|
|
126
|
-
'no-obj-calls': 'error',
|
|
127
|
-
'no-object-constructor': 'error',
|
|
128
|
-
'no-octal-escape': 'error',
|
|
129
|
-
'no-octal': 'error',
|
|
130
|
-
'no-promise-executor-return': 'error',
|
|
131
|
-
'no-proto': 'error',
|
|
132
|
-
'no-redeclare': 'error',
|
|
133
|
-
'no-regex-spaces': 'error',
|
|
134
|
-
'no-restricted-globals': ['error', {
|
|
135
|
-
name: 'event',
|
|
136
|
-
message: 'Use local parameter instead.'
|
|
137
|
-
}],
|
|
138
|
-
'no-restricted-syntax': ['error', 'WithStatement'],
|
|
139
|
-
'no-return-assign': 'error',
|
|
140
|
-
'no-script-url': 'error',
|
|
141
|
-
'no-self-assign': 'error',
|
|
142
|
-
'no-self-compare': 'error',
|
|
143
|
-
'no-sequences': 'error',
|
|
144
|
-
'no-setter-return': 'error',
|
|
145
|
-
'no-shadow-restricted-names': 'error',
|
|
146
|
-
'no-shadow': 'error',
|
|
147
|
-
'no-sparse-arrays': 'error',
|
|
148
|
-
'no-this-before-super': 'error',
|
|
149
|
-
'no-throw-literal': 'error',
|
|
150
|
-
'no-undef-init': 'error',
|
|
151
|
-
'no-undef': 'error',
|
|
152
|
-
'no-unexpected-multiline': 'error',
|
|
153
|
-
'no-unmodified-loop-condition': 'error',
|
|
154
|
-
'no-unneeded-ternary': 'error',
|
|
155
|
-
'no-unreachable-loop': 'error',
|
|
156
|
-
'no-unreachable': 'error',
|
|
157
|
-
'no-unsafe-finally': 'error',
|
|
158
|
-
'no-unsafe-negation': 'error',
|
|
159
|
-
'no-unsafe-optional-chaining': 'error',
|
|
160
|
-
'no-unused-labels': 'error',
|
|
161
|
-
'no-unused-private-class-members': 'warn',
|
|
162
|
-
'no-unused-vars': ['error', {
|
|
163
|
-
argsIgnorePattern: '^_',
|
|
164
|
-
varsIgnorePattern: '^ignore(d)?',
|
|
165
|
-
args: 'after-used',
|
|
166
|
-
ignoreRestSiblings: true
|
|
167
|
-
}],
|
|
168
|
-
'no-use-before-define': ['error', 'nofunc'],
|
|
169
|
-
'no-useless-assignment': 'warn',
|
|
170
|
-
'no-useless-backreference': 'error',
|
|
171
|
-
'no-useless-call': 'error',
|
|
172
|
-
'no-useless-catch': 'error',
|
|
173
|
-
'no-useless-computed-key': 'error',
|
|
174
|
-
'no-useless-concat': 'error',
|
|
175
|
-
'no-useless-constructor': 'error',
|
|
176
|
-
'no-useless-escape': 'error',
|
|
177
|
-
'no-useless-rename': 'error',
|
|
178
|
-
'no-useless-return': 'error',
|
|
179
|
-
'no-var': 'warn',
|
|
180
|
-
'no-warning-comments': ['warn', {
|
|
181
|
-
terms: ['fixme'],
|
|
182
|
-
location: 'anywhere'
|
|
183
|
-
}],
|
|
184
|
-
'object-shorthand': ['error', 'properties'],
|
|
185
|
-
'one-var': ['error', {
|
|
186
|
-
uninitialized: 'never',
|
|
187
|
-
initialized: 'never'
|
|
188
|
-
}],
|
|
189
|
-
'prefer-arrow-callback': ['warn', {
|
|
190
|
-
allowNamedFunctions: true,
|
|
191
|
-
allowUnboundThis: true
|
|
192
|
-
}],
|
|
193
|
-
'prefer-const': 'warn',
|
|
194
|
-
'preserve-caught-error': (0, _conditions.strict)(options, ['warn', {
|
|
195
|
-
requireCatchParameter: true
|
|
196
|
-
}]),
|
|
197
|
-
'prefer-destructuring': ['warn', {
|
|
198
|
-
object: true,
|
|
199
|
-
array: false
|
|
200
|
-
}],
|
|
201
|
-
'prefer-exponentiation-operator': 'warn',
|
|
202
|
-
'prefer-numeric-literals': 'error',
|
|
203
|
-
'prefer-object-has-own': 'warn',
|
|
204
|
-
'prefer-rest-params': 'error',
|
|
205
|
-
'prefer-spread': 'error',
|
|
206
|
-
'prefer-template': 'error',
|
|
207
|
-
'prefer-promise-reject-errors': 'warn',
|
|
208
|
-
'radix': 'error',
|
|
209
|
-
'require-await': 'error',
|
|
210
|
-
'require-yield': 'error',
|
|
211
|
-
'strict': 'error',
|
|
212
|
-
'symbol-description': 'error',
|
|
213
|
-
'use-isnan': 'error',
|
|
214
|
-
'valid-typeof': 'error',
|
|
215
|
-
'vars-on-top': 'error',
|
|
216
|
-
'yoda': 'error',
|
|
217
|
-
'require-atomic-updates': 'warn',
|
|
218
|
-
'no-async-promise-executor': 'warn',
|
|
219
|
-
'grouped-accessor-pairs': 'warn',
|
|
220
|
-
'no-extra-boolean-cast': 'warn',
|
|
221
|
-
'no-param-reassign': 'warn',
|
|
222
|
-
'no-plusplus': ['warn', {
|
|
223
|
-
allowForLoopAfterthoughts: true
|
|
224
|
-
}],
|
|
225
|
-
'prefer-regex-literals': ['warn', {
|
|
226
|
-
disallowRedundantWrapping: true
|
|
227
|
-
}],
|
|
228
|
-
'no-console': (0, _conditions.strict)(options, 'warn')
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(baseConfig, overrides);
|
|
232
|
-
}
|
|
233
|
-
module.exports = base;
|
package/cjs/modules/cypress.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
8
|
-
var _eslintPluginCypress = _interopRequireDefault(require("eslint-plugin-cypress"));
|
|
9
|
-
var _globs = require("../utils/globs.js");
|
|
10
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* @param { import('../types').Options } options
|
|
14
|
-
* @return { import('eslint').Linter.Config }
|
|
15
|
-
*/
|
|
16
|
-
function cypress(options = {}) {
|
|
17
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.cypress.overrides);
|
|
18
|
-
const cypressConfig = {
|
|
19
|
-
name: 'cypress',
|
|
20
|
-
files: _globs.globs.e2e,
|
|
21
|
-
plugins: {
|
|
22
|
-
cypress: _eslintPluginCypress.default
|
|
23
|
-
},
|
|
24
|
-
rules: {
|
|
25
|
-
'cypress/assertion-before-screenshot': 'warn',
|
|
26
|
-
'cypress/no-assigning-return-values': 'error',
|
|
27
|
-
'cypress/no-async-tests': 'error',
|
|
28
|
-
'cypress/no-force': 'warn',
|
|
29
|
-
'cypress/no-pause': 'error',
|
|
30
|
-
'cypress/no-unnecessary-waiting': 'error',
|
|
31
|
-
'cypress/require-data-selectors': 'off',
|
|
32
|
-
'cypress/unsafe-to-chain-command': 'error',
|
|
33
|
-
'cypress/no-chained-get': 'error',
|
|
34
|
-
'@typescript-eslint/no-namespace': 'off'
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(cypressConfig, overrides);
|
|
38
|
-
}
|
|
39
|
-
module.exports = cypress;
|
package/cjs/modules/ignore.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _config = require("eslint/config");
|
|
8
|
-
var _getGitignorePatterns = require("../utils/getGitignorePatterns.js");
|
|
9
|
-
var _globs = require("../utils/globs.js");
|
|
10
|
-
/**
|
|
11
|
-
* @param { import('../types').Options } options
|
|
12
|
-
* @return { import('eslint').Linter.Config }
|
|
13
|
-
*/
|
|
14
|
-
function ignores(options = {}) {
|
|
15
|
-
const ignorePatterns = [..._globs.ignoreGlobs, ...(options.ignores ?? [])];
|
|
16
|
-
const shouldUseGitignore = options.gitignore && options.gitignore.length > 0;
|
|
17
|
-
if (shouldUseGitignore) {
|
|
18
|
-
const gitignorePatterns = (0, _getGitignorePatterns.getGitignorePatterns)(options.gitignore);
|
|
19
|
-
if (gitignorePatterns.length > 0) {
|
|
20
|
-
ignorePatterns.push(...gitignorePatterns);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const uniqueIgnorePatterns = [...new Set(ignorePatterns)];
|
|
24
|
-
return (0, _config.globalIgnores)(uniqueIgnorePatterns, 'ignores');
|
|
25
|
-
}
|
|
26
|
-
module.exports = ignores;
|
package/cjs/modules/imports.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
8
|
-
var _eslintPluginImportX = _interopRequireDefault(require("eslint-plugin-import-x"));
|
|
9
|
-
var _conditions = require("../utils/conditions.js");
|
|
10
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const tsExtensions = ['.ts', '.tsx', '.cts', '.mts', '.ctsx', '.mtsx'];
|
|
13
|
-
const jsExtensions = ['.mjs', '.js', '.jsx', '.cjs'];
|
|
14
|
-
const allExtensions = [...jsExtensions, ...tsExtensions];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @param { import('../types').Options } options
|
|
18
|
-
* @return { import('eslint').Linter.Config }
|
|
19
|
-
*/
|
|
20
|
-
function imports(options = {}) {
|
|
21
|
-
const isObject = typeof options.import === 'object';
|
|
22
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.import.overrides);
|
|
23
|
-
const importsConfig = {
|
|
24
|
-
name: 'imports',
|
|
25
|
-
plugins: {
|
|
26
|
-
import: _eslintPluginImportX.default
|
|
27
|
-
},
|
|
28
|
-
settings: {
|
|
29
|
-
'import-x/extensions': jsExtensions,
|
|
30
|
-
'import-x/ignore': ['node_modules', '\\.(scss|css|svg|json|mdx)$'],
|
|
31
|
-
...(0, _conditions.predicate)(options.typescript, {
|
|
32
|
-
'import-x/parsers': {
|
|
33
|
-
'@typescript-eslint/parser': tsExtensions
|
|
34
|
-
},
|
|
35
|
-
'import-x/extensions': allExtensions
|
|
36
|
-
}),
|
|
37
|
-
...(0, _conditions.predicate)(isObject && 'internalRegExp' in options.import, {
|
|
38
|
-
'import-x/internal-regex': options.import.internalRegExp
|
|
39
|
-
}),
|
|
40
|
-
...(0, _conditions.predicate)(isObject && 'lifetime' in options.import, {
|
|
41
|
-
'import-x/cache': {
|
|
42
|
-
lifetime: options.import.lifetime
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
},
|
|
46
|
-
rules: {
|
|
47
|
-
'import/consistent-type-specifier-style': ['warn', 'prefer-top-level'],
|
|
48
|
-
/*
|
|
49
|
-
* FIXME: This rule is broken!
|
|
50
|
-
const opt = options.esm ? 'always' : 'never';
|
|
51
|
-
'import/extensions': [
|
|
52
|
-
'error',
|
|
53
|
-
opt,
|
|
54
|
-
{
|
|
55
|
-
ignorePackages: true,
|
|
56
|
-
js: opt,
|
|
57
|
-
jsx: opt,
|
|
58
|
-
mjs: opt,
|
|
59
|
-
cjs: opt,
|
|
60
|
-
...(options.typescript && { ts: opt, tsx: opt, mts: opt, cts: opt }),
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
*/
|
|
64
|
-
'import/first': 'error',
|
|
65
|
-
'import/newline-after-import': 'warn',
|
|
66
|
-
'import/no-absolute-path': 'error',
|
|
67
|
-
'import/no-amd': 'error',
|
|
68
|
-
'import/no-duplicates': 'error',
|
|
69
|
-
'import/no-empty-named-blocks': 'error',
|
|
70
|
-
'import/no-extraneous-dependencies': ['error', {
|
|
71
|
-
devDependencies: true
|
|
72
|
-
}],
|
|
73
|
-
'import/no-mutable-exports': 'error',
|
|
74
|
-
'import/no-named-as-default': 'error',
|
|
75
|
-
'import/no-named-default': 'error',
|
|
76
|
-
'import/no-relative-packages': 'error',
|
|
77
|
-
'import/no-self-import': 'error',
|
|
78
|
-
'import/no-unresolved': ['error', {
|
|
79
|
-
caseSensitiveStrict: true
|
|
80
|
-
}],
|
|
81
|
-
'import/no-useless-path-segments': 'warn',
|
|
82
|
-
'import/no-webpack-loader-syntax': 'error',
|
|
83
|
-
'import/order': 'off',
|
|
84
|
-
...(0, _conditions.predicate)(!options.disableExpensiveRules, {
|
|
85
|
-
'import/default': 'error',
|
|
86
|
-
'import/export': 'error',
|
|
87
|
-
'import/named': 'error',
|
|
88
|
-
'import/namespace': 'error',
|
|
89
|
-
'import/no-cycle': ['error', {
|
|
90
|
-
maxDepth: Infinity
|
|
91
|
-
}],
|
|
92
|
-
'import/no-deprecated': 'warn',
|
|
93
|
-
'import/no-named-as-default-member': 'error'
|
|
94
|
-
}),
|
|
95
|
-
'import/dynamic-import-chunkname': 'off',
|
|
96
|
-
'import/exports-last': 'off',
|
|
97
|
-
'import/group-exports': 'off',
|
|
98
|
-
'import/max-dependencies': 'off',
|
|
99
|
-
'import/no-anonymous-default-export': 'off',
|
|
100
|
-
'import/no-commonjs': 'off',
|
|
101
|
-
'import/no-default-export': 'off',
|
|
102
|
-
'import/no-dynamic-require': 'off',
|
|
103
|
-
'import/no-import-module-exports': 'off',
|
|
104
|
-
'import/no-internal-modules': 'off',
|
|
105
|
-
'import/no-named-export': 'off',
|
|
106
|
-
'import/no-namespace': 'off',
|
|
107
|
-
'import/no-nodejs-modules': 'off',
|
|
108
|
-
'import/no-relative-parent-imports': 'off',
|
|
109
|
-
'import/no-restricted-paths': 'off',
|
|
110
|
-
'import/no-unassigned-import': 'off',
|
|
111
|
-
'import/no-unused-modules': 'off',
|
|
112
|
-
'import/prefer-default-export': 'off',
|
|
113
|
-
'import/unambiguous': 'off',
|
|
114
|
-
...(0, _conditions.predicate)(options.typescript, {
|
|
115
|
-
'import/default': 'off',
|
|
116
|
-
'import/named': 'off',
|
|
117
|
-
'import/no-named-as-default-member': 'off',
|
|
118
|
-
'import/no-unresolved': 'off'
|
|
119
|
-
})
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(importsConfig, overrides);
|
|
123
|
-
}
|
|
124
|
-
module.exports = imports;
|
package/cjs/modules/jest.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
8
|
-
var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
|
|
9
|
-
var _globals = _interopRequireDefault(require("globals"));
|
|
10
|
-
var _conditions = require("../utils/conditions.js");
|
|
11
|
-
var _globs = require("../utils/globs.js");
|
|
12
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/**
|
|
15
|
-
* @param { import('../types').Options } options
|
|
16
|
-
* @return { import('eslint').Linter.Config } */
|
|
17
|
-
function jest(options = {}) {
|
|
18
|
-
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
19
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.jest.overrides);
|
|
20
|
-
const jestConfig = {
|
|
21
|
-
name: 'jest',
|
|
22
|
-
files: _globs.globs.test,
|
|
23
|
-
plugins: {
|
|
24
|
-
jest: _eslintPluginJest.default
|
|
25
|
-
},
|
|
26
|
-
languageOptions: {
|
|
27
|
-
globals: {
|
|
28
|
-
..._globals.default.jest
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
rules: {
|
|
32
|
-
'jest/consistent-test-it': 'off',
|
|
33
|
-
'jest/expect-expect': 'off',
|
|
34
|
-
'jest/lowercase-name': 'off',
|
|
35
|
-
'jest/max-nested-describe': ['error', {
|
|
36
|
-
max: 2
|
|
37
|
-
}],
|
|
38
|
-
'jest/no-alias-methods': 'error',
|
|
39
|
-
'jest/no-commented-out-tests': 'warn',
|
|
40
|
-
'jest/no-conditional-expect': 'error',
|
|
41
|
-
'jest/no-conditional-in-test': 'error',
|
|
42
|
-
'jest/no-confusing-set-timeout': 'warn',
|
|
43
|
-
'jest/no-done-callback': 'warn',
|
|
44
|
-
'jest/no-expect-resolves': 'off',
|
|
45
|
-
'jest/no-export': 'error',
|
|
46
|
-
...(0, _conditions.predicate)(projectService, {
|
|
47
|
-
'jest/no-error-equal': 'error',
|
|
48
|
-
'jest/no-unnecessary-assertion': 'warn'
|
|
49
|
-
}),
|
|
50
|
-
'jest/no-hooks': 'off',
|
|
51
|
-
'jest/no-interpolation-in-snapshots': 'error',
|
|
52
|
-
'jest/no-jasmine-globals': 'off',
|
|
53
|
-
'jest/no-large-snapshots': ['warn', {
|
|
54
|
-
maxSize: 300
|
|
55
|
-
}],
|
|
56
|
-
'jest/no-mocks-import': 'error',
|
|
57
|
-
'jest/no-restricted-jest-methods': 'off',
|
|
58
|
-
'jest/no-restricted-matchers': 'error',
|
|
59
|
-
'jest/no-standalone-expect': 'off',
|
|
60
|
-
'jest/no-test-callback': 'off',
|
|
61
|
-
'jest/no-test-prefixes': 'error',
|
|
62
|
-
'jest/no-test-return-statement': 'off',
|
|
63
|
-
'jest/no-unneeded-async-expect-function': 'warn',
|
|
64
|
-
'jest/no-truthy-falsy': 'off',
|
|
65
|
-
'jest/prefer-called-with': 'error',
|
|
66
|
-
'jest/prefer-each': 'warn',
|
|
67
|
-
'jest/prefer-expect-assertions': 'off',
|
|
68
|
-
'jest/prefer-expect-resolves': 'warn',
|
|
69
|
-
'jest/prefer-hooks-on-top': 'error',
|
|
70
|
-
'jest/prefer-inline-snapshots': 'off',
|
|
71
|
-
'jest/prefer-lowercase-title': 'off',
|
|
72
|
-
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
73
|
-
'jest/prefer-mock-return-shorthand': 'warn',
|
|
74
|
-
'jest/prefer-snapshot-hint': 'warn',
|
|
75
|
-
'jest/prefer-spy-on': 'off',
|
|
76
|
-
'jest/prefer-strict-equal': 'off',
|
|
77
|
-
'jest/prefer-to-be-null': 'off',
|
|
78
|
-
'jest/prefer-to-be-undefined': 'off',
|
|
79
|
-
'jest/prefer-to-be': 'warn',
|
|
80
|
-
'jest/prefer-to-contain': 'warn',
|
|
81
|
-
'jest/prefer-to-have-length': 'warn',
|
|
82
|
-
'jest/prefer-todo': 'warn',
|
|
83
|
-
'jest/require-hook': 'off',
|
|
84
|
-
'jest/require-to-throw-message': 'off',
|
|
85
|
-
'jest/require-top-level-describe': 'off',
|
|
86
|
-
'jest/valid-describe-callback': 'error',
|
|
87
|
-
'jest/valid-expect-in-promise': 'error',
|
|
88
|
-
'jest/valid-expect': 'error',
|
|
89
|
-
'jest/valid-title': 'warn',
|
|
90
|
-
'jest/no-deprecated-functions': 'error',
|
|
91
|
-
'jest/valid-mock-module-path': 'warn'
|
|
92
|
-
|
|
93
|
-
// ...predicate(options.typescript, {
|
|
94
|
-
// '@typescript-eslint/unbound-method': 'off',
|
|
95
|
-
// 'jest/unbound-method': 'error',
|
|
96
|
-
// 'jest/no-untyped-mock-factory': 'warn',
|
|
97
|
-
// }),
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(jestConfig, overrides);
|
|
101
|
-
}
|
|
102
|
-
module.exports = jest;
|
package/cjs/modules/next.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintPluginNext = _interopRequireDefault(require("@next/eslint-plugin-next"));
|
|
8
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
9
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/**
|
|
12
|
-
* @param { import('../types').Options } options
|
|
13
|
-
* @return { import('eslint').Linter.Config }
|
|
14
|
-
*/
|
|
15
|
-
function next(options = {}) {
|
|
16
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.next.overrides);
|
|
17
|
-
const nextConfig = {
|
|
18
|
-
name: 'next',
|
|
19
|
-
plugins: {
|
|
20
|
-
next: _eslintPluginNext.default
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
'next/google-font-display': 'warn',
|
|
24
|
-
'next/google-font-preconnect': 'warn',
|
|
25
|
-
'next/inline-script-id': 'warn',
|
|
26
|
-
'next/next-script-for-ga': 'warn',
|
|
27
|
-
'next/no-assign-module-variable': 'warn',
|
|
28
|
-
'next/no-async-client-component': 'warn',
|
|
29
|
-
'next/no-before-interactive-script-outside-document': 'warn',
|
|
30
|
-
'next/no-css-tags': 'warn',
|
|
31
|
-
'next/no-document-import-in-page': 'warn',
|
|
32
|
-
'next/no-duplicate-head': 'warn',
|
|
33
|
-
'next/no-head-element': 'warn',
|
|
34
|
-
'next/no-head-import-in-document': 'warn',
|
|
35
|
-
'next/no-html-link-for-pages': 'warn',
|
|
36
|
-
'next/no-img-element': 'warn',
|
|
37
|
-
'next/no-page-custom-font': 'warn',
|
|
38
|
-
'next/no-script-component-in-head': 'warn',
|
|
39
|
-
'next/no-styled-jsx-in-document': 'warn',
|
|
40
|
-
'next/no-sync-scripts': 'warn',
|
|
41
|
-
'next/no-title-in-document-head': 'warn',
|
|
42
|
-
'next/no-typos': 'warn',
|
|
43
|
-
'next/no-unwanted-polyfillio': 'warn'
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(nextConfig, overrides);
|
|
47
|
-
}
|
|
48
|
-
module.exports = next;
|
package/cjs/modules/node.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
8
|
-
var _eslintPluginN = _interopRequireDefault(require("eslint-plugin-n"));
|
|
9
|
-
var _conditions = require("../utils/conditions.js");
|
|
10
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* @param { import('../types').Options } options
|
|
14
|
-
* @return { import('eslint').Linter.Config }
|
|
15
|
-
*/
|
|
16
|
-
function node(options = {}) {
|
|
17
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.node.overrides);
|
|
18
|
-
const nodeConfig = {
|
|
19
|
-
name: 'node',
|
|
20
|
-
plugins: {
|
|
21
|
-
n: _eslintPluginN.default
|
|
22
|
-
},
|
|
23
|
-
rules: {
|
|
24
|
-
'n/callback-return': 'off',
|
|
25
|
-
'n/exports-style': ['error', 'module.exports', {
|
|
26
|
-
allowBatchAssign: false
|
|
27
|
-
}],
|
|
28
|
-
'n/global-require': 'warn',
|
|
29
|
-
'n/handle-callback-err': 'warn',
|
|
30
|
-
'n/hashbang': 'off',
|
|
31
|
-
// Cannot ignore other files
|
|
32
|
-
'n/no-callback-literal': 'off',
|
|
33
|
-
'n/no-deprecated-api': 'error',
|
|
34
|
-
'n/no-exports-assign': 'error',
|
|
35
|
-
'n/no-mixed-requires': 'warn',
|
|
36
|
-
'n/no-new-require': 'error',
|
|
37
|
-
'n/no-path-concat': 'error',
|
|
38
|
-
'n/no-process-env': 'error',
|
|
39
|
-
'n/no-process-exit': 'off',
|
|
40
|
-
'n/no-restricted-import': 'off',
|
|
41
|
-
'n/no-restricted-require': 'off',
|
|
42
|
-
'n/no-sync': (0, _conditions.strict)(options, 'warn'),
|
|
43
|
-
'n/no-top-level-await': 'off',
|
|
44
|
-
'n/no-unpublished-bin': 'warn',
|
|
45
|
-
'n/no-unpublished-import': 'off',
|
|
46
|
-
'n/no-unpublished-require': 'warn',
|
|
47
|
-
'n/no-unsupported-features/es-builtins': 'off',
|
|
48
|
-
// Nice but not a general rule
|
|
49
|
-
'n/no-unsupported-features/es-syntax': 'off',
|
|
50
|
-
// Nice but not a general rule
|
|
51
|
-
'n/no-unsupported-features/node-builtins': 'off',
|
|
52
|
-
// Nice but not a general rule
|
|
53
|
-
'n/prefer-global/buffer': 'warn',
|
|
54
|
-
'n/prefer-global/console': 'warn',
|
|
55
|
-
'n/prefer-global/crypto': 'warn',
|
|
56
|
-
'n/prefer-global/text-decoder': 'warn',
|
|
57
|
-
'n/prefer-global/text-encoder': 'warn',
|
|
58
|
-
'n/prefer-global/timers': 'warn',
|
|
59
|
-
'n/prefer-global/url-search-params': 'warn',
|
|
60
|
-
'n/prefer-global/url': 'warn',
|
|
61
|
-
'n/prefer-node-protocol': 'warn',
|
|
62
|
-
'n/prefer-promises/dns': 'warn',
|
|
63
|
-
'n/prefer-promises/fs': 'warn',
|
|
64
|
-
'n/process-exit-as-throw': 'error',
|
|
65
|
-
// Disabled
|
|
66
|
-
'n/prefer-global/process': 'off',
|
|
67
|
-
'n/file-extension-in-import': 'off',
|
|
68
|
-
'n/no-extraneous-import': 'off',
|
|
69
|
-
'n/no-extraneous-require': 'off',
|
|
70
|
-
'n/no-missing-import': 'off',
|
|
71
|
-
'n/no-missing-require': 'off'
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(nodeConfig, overrides);
|
|
75
|
-
}
|
|
76
|
-
module.exports = node;
|