@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/stylistic.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintPlugin = _interopRequireDefault(require("@stylistic/eslint-plugin"));
|
|
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 { Promise<import('eslint').Linter.Config> }
|
|
14
|
-
*/
|
|
15
|
-
function stylistic(options = {}) {
|
|
16
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.stylistic.overrides);
|
|
17
|
-
const stylisticConfig = {
|
|
18
|
-
name: 'stylistic',
|
|
19
|
-
plugins: {
|
|
20
|
-
'@stylistic': _eslintPlugin.default
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
'@stylistic/jsx-curly-brace-presence': ['warn', {
|
|
24
|
-
props: 'never',
|
|
25
|
-
children: 'never',
|
|
26
|
-
propElementValues: 'always'
|
|
27
|
-
}],
|
|
28
|
-
'@stylistic/jsx-self-closing-comp': ['warn', {
|
|
29
|
-
component: true,
|
|
30
|
-
html: true
|
|
31
|
-
}],
|
|
32
|
-
'@stylistic/no-mixed-operators': 'off',
|
|
33
|
-
//conflict with prettier
|
|
34
|
-
'@stylistic/padding-line-between-statements': ['warn', {
|
|
35
|
-
blankLine: 'always',
|
|
36
|
-
prev: ['case', 'default'],
|
|
37
|
-
next: '*'
|
|
38
|
-
}, {
|
|
39
|
-
blankLine: 'always',
|
|
40
|
-
prev: '*',
|
|
41
|
-
next: 'multiline-block-like'
|
|
42
|
-
}, {
|
|
43
|
-
blankLine: 'always',
|
|
44
|
-
prev: 'multiline-block-like',
|
|
45
|
-
next: '*'
|
|
46
|
-
}, {
|
|
47
|
-
blankLine: 'always',
|
|
48
|
-
prev: ['type', 'interface'],
|
|
49
|
-
next: '*'
|
|
50
|
-
}, {
|
|
51
|
-
blankLine: 'always',
|
|
52
|
-
prev: 'directive',
|
|
53
|
-
next: '*'
|
|
54
|
-
}, {
|
|
55
|
-
blankLine: 'never',
|
|
56
|
-
prev: 'directive',
|
|
57
|
-
next: 'directive'
|
|
58
|
-
}, {
|
|
59
|
-
blankLine: 'always',
|
|
60
|
-
prev: 'import',
|
|
61
|
-
next: '*'
|
|
62
|
-
}, {
|
|
63
|
-
blankLine: 'any',
|
|
64
|
-
prev: '*',
|
|
65
|
-
next: 'import'
|
|
66
|
-
}, {
|
|
67
|
-
blankLine: 'always',
|
|
68
|
-
prev: 'directive',
|
|
69
|
-
next: 'import'
|
|
70
|
-
}, {
|
|
71
|
-
blankLine: 'any',
|
|
72
|
-
prev: ['if'],
|
|
73
|
-
next: ['if']
|
|
74
|
-
}],
|
|
75
|
-
'@stylistic/lines-between-class-members': ['warn', {
|
|
76
|
-
enforce: [{
|
|
77
|
-
blankLine: 'never',
|
|
78
|
-
prev: 'field',
|
|
79
|
-
next: 'field'
|
|
80
|
-
}, {
|
|
81
|
-
blankLine: 'always',
|
|
82
|
-
prev: '*',
|
|
83
|
-
next: 'method'
|
|
84
|
-
}, {
|
|
85
|
-
blankLine: 'always',
|
|
86
|
-
prev: 'method',
|
|
87
|
-
next: '*'
|
|
88
|
-
}]
|
|
89
|
-
}]
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(stylisticConfig, overrides);
|
|
93
|
-
}
|
|
94
|
-
module.exports = stylistic;
|
package/cjs/modules/tailwind.js
DELETED
|
@@ -1,56 +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 _conditions = require("../utils/conditions.js");
|
|
9
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
10
|
-
/**
|
|
11
|
-
* @param { import('../types').Options } options
|
|
12
|
-
* @return { Promise<import('eslint').Linter.Config> }
|
|
13
|
-
*/
|
|
14
|
-
async function tailwind(options = {}) {
|
|
15
|
-
const plugin = await Promise.resolve().then(() => require('eslint-plugin-better-tailwindcss'));
|
|
16
|
-
const isObject = typeof options.tailwind === 'object';
|
|
17
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.tailwind.overrides);
|
|
18
|
-
const tailwindConfig = {
|
|
19
|
-
name: 'tailwind',
|
|
20
|
-
plugins: {
|
|
21
|
-
'better-tailwindcss': plugin.default ?? plugin
|
|
22
|
-
},
|
|
23
|
-
settings: {
|
|
24
|
-
'better-tailwindcss': {
|
|
25
|
-
...(0, _conditions.predicate)(isObject && 'entryPoint' in options.tailwind, {
|
|
26
|
-
entryPoint: options.tailwind.entryPoint
|
|
27
|
-
}),
|
|
28
|
-
...(0, _conditions.predicate)(isObject && 'tailwindConfig' in options.tailwind, {
|
|
29
|
-
tailwindConfig: options.tailwind.tailwindConfig
|
|
30
|
-
}),
|
|
31
|
-
callees: [['^class|classnames|classNames|cva|ctl|clsx|cn|cns|cx|cc|clb|cnb|dcnb|objstr|tv|twJoin|twMerge$', [{
|
|
32
|
-
match: 'strings'
|
|
33
|
-
}]]]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
rules: {
|
|
37
|
-
'better-tailwindcss/enforce-canonical-classes': 'warn',
|
|
38
|
-
'better-tailwindcss/enforce-consistent-class-order': 'warn',
|
|
39
|
-
'better-tailwindcss/enforce-consistent-important-position': 'warn',
|
|
40
|
-
'better-tailwindcss/enforce-consistent-line-wrapping': 'off',
|
|
41
|
-
'better-tailwindcss/enforce-consistent-variable-syntax': 'error',
|
|
42
|
-
'better-tailwindcss/enforce-consistent-variant-order': 'warn',
|
|
43
|
-
'better-tailwindcss/enforce-logical-properties': (0, _conditions.strict)('warn'),
|
|
44
|
-
'better-tailwindcss/enforce-shorthand-classes': 'warn',
|
|
45
|
-
'better-tailwindcss/no-concatenated-classes': 'error',
|
|
46
|
-
'better-tailwindcss/no-conflicting-classes': 'error',
|
|
47
|
-
'better-tailwindcss/no-deprecated-classes': 'warn',
|
|
48
|
-
'better-tailwindcss/no-duplicate-classes': 'error',
|
|
49
|
-
'better-tailwindcss/no-restricted-classes': 'warn',
|
|
50
|
-
'better-tailwindcss/no-unknown-classes': (0, _conditions.strict)('warn'),
|
|
51
|
-
'better-tailwindcss/no-unnecessary-whitespace': 'warn'
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(tailwindConfig, overrides);
|
|
55
|
-
}
|
|
56
|
-
module.exports = tailwind;
|
package/cjs/modules/tests.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintPlugin = _interopRequireDefault(require("@vitest/eslint-plugin"));
|
|
8
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
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
|
-
*/
|
|
18
|
-
|
|
19
|
-
function tests(options = {}) {
|
|
20
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.test.overrides);
|
|
21
|
-
const testsConfug = {
|
|
22
|
-
name: 'tests',
|
|
23
|
-
files: [..._globs.globs.test, ..._globs.globs.e2e],
|
|
24
|
-
plugins: {
|
|
25
|
-
vitest: _eslintPlugin.default
|
|
26
|
-
},
|
|
27
|
-
languageOptions: {
|
|
28
|
-
globals: {
|
|
29
|
-
..._globals.default['shared-node-browser']
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
'max-lines-per-function': 'off',
|
|
34
|
-
'no-sparse-arrays': 'off',
|
|
35
|
-
'no-empty-function': 'off',
|
|
36
|
-
'vitest/padding-around-all': 'warn',
|
|
37
|
-
...(0, _conditions.predicate)(options.react, {
|
|
38
|
-
'@eslint-react/no-unstable-context-value': 'off'
|
|
39
|
-
}),
|
|
40
|
-
...(0, _conditions.predicate)(options.typescript, {
|
|
41
|
-
'@typescript-eslint/method-signature-style': 'off',
|
|
42
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
43
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
44
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
45
|
-
'@typescript-eslint/no-floating-promises': 'off',
|
|
46
|
-
'@typescript-eslint/prefer-promise-reject-errors': 'off'
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(testsConfug, overrides);
|
|
51
|
-
}
|
|
52
|
-
module.exports = tests;
|
|
@@ -1,277 +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 _typescriptEslint = require("typescript-eslint");
|
|
9
|
-
var _conditions = require("../utils/conditions.js");
|
|
10
|
-
var _globs = require("../utils/globs.js");
|
|
11
|
-
var _namingConvention = require("../utils/naming-convention.js");
|
|
12
|
-
var _objectOrEmpty = require("../utils/objectOrEmpty.js");
|
|
13
|
-
/**
|
|
14
|
-
* @param { import('../types').Options } options
|
|
15
|
-
* @return { import('eslint').Linter.Config }
|
|
16
|
-
*/
|
|
17
|
-
function typescript(options = {}) {
|
|
18
|
-
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
19
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.typescript.overrides);
|
|
20
|
-
const typescriptConfig = {
|
|
21
|
-
name: 'typescript',
|
|
22
|
-
files: [_globs.globs.ts, _globs.globs.tsx],
|
|
23
|
-
plugins: {
|
|
24
|
-
'@typescript-eslint': _typescriptEslint.plugin
|
|
25
|
-
},
|
|
26
|
-
languageOptions: {
|
|
27
|
-
parser: _typescriptEslint.parser,
|
|
28
|
-
parserOptions: {
|
|
29
|
-
...options.typescript
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
34
|
-
'@typescript-eslint/array-type': 'error',
|
|
35
|
-
'@typescript-eslint/ban-ts-comment': ['error', {
|
|
36
|
-
'ts-expect-error': 'allow-with-description',
|
|
37
|
-
'ts-ignore': 'allow-with-description',
|
|
38
|
-
'ts-nocheck': 'allow-with-description',
|
|
39
|
-
'ts-check': 'allow-with-description',
|
|
40
|
-
'minimumDescriptionLength': 3
|
|
41
|
-
}],
|
|
42
|
-
'@typescript-eslint/ban-tslint-comment': 'off',
|
|
43
|
-
'@typescript-eslint/camelcase': 'off',
|
|
44
|
-
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
|
|
45
|
-
'@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
|
|
46
|
-
'@typescript-eslint/consistent-indexed-object-style': 'warn',
|
|
47
|
-
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
48
|
-
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
|
|
49
|
-
'@typescript-eslint/consistent-type-imports': ['warn', {
|
|
50
|
-
prefer: 'type-imports',
|
|
51
|
-
disallowTypeAnnotations: false,
|
|
52
|
-
fixStyle: 'separate-type-imports'
|
|
53
|
-
}],
|
|
54
|
-
'@typescript-eslint/default-param-last': 'warn',
|
|
55
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
56
|
-
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
57
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
58
|
-
'@typescript-eslint/generic-type-naming': 'off',
|
|
59
|
-
'@typescript-eslint/init-declarations': 'off',
|
|
60
|
-
'@typescript-eslint/member-naming': 'off',
|
|
61
|
-
'@typescript-eslint/member-ordering': 'off',
|
|
62
|
-
'@typescript-eslint/method-signature-style': ['warn', 'property'],
|
|
63
|
-
'@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(projectService ? [{
|
|
64
|
-
selector: 'variable',
|
|
65
|
-
types: ['boolean'],
|
|
66
|
-
format: ['PascalCase'],
|
|
67
|
-
prefix: ['is', 'should', 'has', 'can', 'did', 'will', 'enable', 'loading']
|
|
68
|
-
}] : [])],
|
|
69
|
-
'@typescript-eslint/no-array-constructor': 'error',
|
|
70
|
-
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
71
|
-
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
72
|
-
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
73
|
-
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
74
|
-
'@typescript-eslint/no-empty-function': 'error',
|
|
75
|
-
'@typescript-eslint/no-empty-object-type': ['warn', {
|
|
76
|
-
allowInterfaces: 'with-single-extends'
|
|
77
|
-
}],
|
|
78
|
-
'@typescript-eslint/no-explicit-any': (0, _conditions.strict)(options, 'warn'),
|
|
79
|
-
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
80
|
-
'@typescript-eslint/no-extraneous-class': ['warn', {
|
|
81
|
-
allowWithDecorator: true
|
|
82
|
-
}],
|
|
83
|
-
'@typescript-eslint/no-import-type-side-effects': 'warn',
|
|
84
|
-
'@typescript-eslint/no-inferrable-types': 'off',
|
|
85
|
-
'@typescript-eslint/no-invalid-this': ['error', {
|
|
86
|
-
capIsConstructor: false
|
|
87
|
-
}],
|
|
88
|
-
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
89
|
-
'@typescript-eslint/no-loop-func': 'error',
|
|
90
|
-
'@typescript-eslint/no-magic-numbers': ['off', {
|
|
91
|
-
ignoreEnums: true
|
|
92
|
-
}],
|
|
93
|
-
// Not good enough yet
|
|
94
|
-
'@typescript-eslint/no-misused-new': 'error',
|
|
95
|
-
'@typescript-eslint/no-namespace': 'error',
|
|
96
|
-
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
97
|
-
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
98
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
99
|
-
...(0, _conditions.predicate)(options.strict, {
|
|
100
|
-
'@typescript-eslint/no-non-null-assertion': 'warn'
|
|
101
|
-
}),
|
|
102
|
-
'@typescript-eslint/no-redeclare': ['off', {
|
|
103
|
-
ignoreDeclarationMerge: true
|
|
104
|
-
}],
|
|
105
|
-
// useful in FP.
|
|
106
|
-
'@typescript-eslint/no-require-imports': 'error',
|
|
107
|
-
'@typescript-eslint/no-restricted-imports': 'off',
|
|
108
|
-
'@typescript-eslint/no-shadow': 'error',
|
|
109
|
-
'@typescript-eslint/no-this-alias': 'error',
|
|
110
|
-
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
|
|
111
|
-
'@typescript-eslint/no-unsafe-argument': (0, _conditions.strict)(options, 'warn'),
|
|
112
|
-
'@typescript-eslint/no-unsafe-assignment': (0, _conditions.strict)(options, 'warn'),
|
|
113
|
-
'@typescript-eslint/no-unsafe-call': (0, _conditions.strict)(options, 'warn'),
|
|
114
|
-
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
|
|
115
|
-
'@typescript-eslint/no-unsafe-member-access': (0, _conditions.strict)(options, ['warn', {
|
|
116
|
-
allowOptionalChaining: true
|
|
117
|
-
}]),
|
|
118
|
-
'@typescript-eslint/no-unsafe-return': (0, _conditions.strict)(options, 'warn'),
|
|
119
|
-
'@typescript-eslint/no-untyped-public-signature': 'off',
|
|
120
|
-
'@typescript-eslint/no-unused-expressions': 'error',
|
|
121
|
-
'@typescript-eslint/no-unused-vars': ['warn', {
|
|
122
|
-
argsIgnorePattern: '^_',
|
|
123
|
-
varsIgnorePattern: '^([iI]gnore(d)?)|(_+)',
|
|
124
|
-
caughtErrorsIgnorePattern: '^_',
|
|
125
|
-
destructuredArrayIgnorePattern: '^_',
|
|
126
|
-
args: 'after-used',
|
|
127
|
-
caughtErrors: 'all',
|
|
128
|
-
ignoreRestSiblings: true
|
|
129
|
-
}],
|
|
130
|
-
'@typescript-eslint/no-use-before-define': ['error', {
|
|
131
|
-
functions: false,
|
|
132
|
-
classes: true
|
|
133
|
-
}],
|
|
134
|
-
'@typescript-eslint/no-useless-constructor': 'error',
|
|
135
|
-
'@typescript-eslint/no-useless-default-assignment': 'warn',
|
|
136
|
-
'@typescript-eslint/no-useless-empty-export': 'warn',
|
|
137
|
-
'@typescript-eslint/parameter-properties': 'off',
|
|
138
|
-
'@typescript-eslint/prefer-as-const': 'warn',
|
|
139
|
-
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
140
|
-
'@typescript-eslint/prefer-for-of': 'warn',
|
|
141
|
-
'@typescript-eslint/prefer-function-type': 'warn',
|
|
142
|
-
'@typescript-eslint/prefer-literal-enum-member': ['error', {
|
|
143
|
-
allowBitwiseExpressions: true
|
|
144
|
-
}],
|
|
145
|
-
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
146
|
-
'@typescript-eslint/prefer-readonly-parameter-types': ['off', {
|
|
147
|
-
checkParameterProperties: true,
|
|
148
|
-
ignoreInferredTypes: false,
|
|
149
|
-
treatMethodsAsReadonly: true
|
|
150
|
-
}],
|
|
151
|
-
// I'm not sure...
|
|
152
|
-
'@typescript-eslint/prefer-readonly': 'off',
|
|
153
|
-
'@typescript-eslint/prefer-readonlysemi': 'off',
|
|
154
|
-
// Annoying with auto-fix on save.
|
|
155
|
-
'@typescript-eslint/promise-function-async': 'off',
|
|
156
|
-
// Breaks react component when return type is React.ReactNode
|
|
157
|
-
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
158
|
-
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
159
|
-
// Annoying
|
|
160
|
-
|
|
161
|
-
'@typescript-eslint/triple-slash-reference': 'error',
|
|
162
|
-
'@typescript-eslint/unified-signatures': 'error',
|
|
163
|
-
...(0, _conditions.predicate)(projectService, {
|
|
164
|
-
'@typescript-eslint/await-thenable': 'error',
|
|
165
|
-
'@typescript-eslint/consistent-return': 'off',
|
|
166
|
-
'@typescript-eslint/consistent-type-exports': 'warn',
|
|
167
|
-
'@typescript-eslint/dot-notation': ['warn', {
|
|
168
|
-
allowPrivateClassPropertyAccess: false,
|
|
169
|
-
allowProtectedClassPropertyAccess: false,
|
|
170
|
-
allowIndexSignaturePropertyAccess: true
|
|
171
|
-
}],
|
|
172
|
-
'@typescript-eslint/no-base-to-string': 'error',
|
|
173
|
-
'@typescript-eslint/no-confusing-void-expression': ['off', {
|
|
174
|
-
ignoreArrowShorthand: true,
|
|
175
|
-
ignoreVoidOperator: true
|
|
176
|
-
}],
|
|
177
|
-
// Annoying and conflict with @typescript-eslint/no-meaningless-void-operator
|
|
178
|
-
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
|
|
179
|
-
'@typescript-eslint/no-deprecated': 'error',
|
|
180
|
-
'@typescript-eslint/no-for-in-array': 'error',
|
|
181
|
-
'@typescript-eslint/no-implied-eval': 'error',
|
|
182
|
-
'@typescript-eslint/no-meaningless-void-operator': ['warn', {
|
|
183
|
-
checkNever: false
|
|
184
|
-
}],
|
|
185
|
-
...(0, _conditions.predicate)(!options.disableExpensiveRules, {
|
|
186
|
-
'@typescript-eslint/no-floating-promises': ['error', {
|
|
187
|
-
ignoreVoid: true
|
|
188
|
-
}],
|
|
189
|
-
'@typescript-eslint/no-misused-promises': ['warn', {
|
|
190
|
-
checksVoidReturn: {
|
|
191
|
-
attributes: false
|
|
192
|
-
}
|
|
193
|
-
}]
|
|
194
|
-
}),
|
|
195
|
-
'@typescript-eslint/no-misused-spread': 'error',
|
|
196
|
-
'@typescript-eslint/no-mixed-enums': 'error',
|
|
197
|
-
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
198
|
-
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
|
|
199
|
-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
200
|
-
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
201
|
-
'@typescript-eslint/no-unsafe-function-type': 'warn',
|
|
202
|
-
'@typescript-eslint/no-unnecessary-condition': ['warn', {
|
|
203
|
-
allowConstantLoopConditions: false
|
|
204
|
-
}],
|
|
205
|
-
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
206
|
-
'@typescript-eslint/no-unnecessary-template-expression': 'warn',
|
|
207
|
-
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
208
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
209
|
-
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
210
|
-
'@typescript-eslint/no-unused-private-class-members': 'warn',
|
|
211
|
-
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
|
|
212
|
-
'@typescript-eslint/only-throw-error': ['warn', {
|
|
213
|
-
allowRethrowing: true
|
|
214
|
-
}],
|
|
215
|
-
'@typescript-eslint/prefer-includes': 'warn',
|
|
216
|
-
'@typescript-eslint/prefer-optional-chain': 'warn',
|
|
217
|
-
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
218
|
-
'@typescript-eslint/prefer-nullish-coalescing': ['warn', {
|
|
219
|
-
ignoreConditionalTests: false,
|
|
220
|
-
ignoreTernaryTests: false,
|
|
221
|
-
ignoreMixedLogicalExpressions: true
|
|
222
|
-
}],
|
|
223
|
-
'@typescript-eslint/prefer-regexp-exec': 'warn',
|
|
224
|
-
'@typescript-eslint/prefer-promise-reject-errors': 'warn',
|
|
225
|
-
'@typescript-eslint/prefer-return-this-type': 'warn',
|
|
226
|
-
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
|
|
227
|
-
'@typescript-eslint/restrict-template-expressions': ['warn', {
|
|
228
|
-
allowNumber: true,
|
|
229
|
-
allowBoolean: false,
|
|
230
|
-
allowAny: false,
|
|
231
|
-
allowNullish: false,
|
|
232
|
-
allowRegExp: false,
|
|
233
|
-
allowNever: false
|
|
234
|
-
}],
|
|
235
|
-
'@typescript-eslint/related-getter-setter-pairs': 'error',
|
|
236
|
-
'@typescript-eslint/require-array-sort-compare': ['error', {
|
|
237
|
-
ignoreStringArrays: true
|
|
238
|
-
}],
|
|
239
|
-
'@typescript-eslint/require-await': 'error',
|
|
240
|
-
'@typescript-eslint/return-await': 'error',
|
|
241
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
242
|
-
'@typescript-eslint/unbound-method': ['error', {
|
|
243
|
-
ignoreStatic: true
|
|
244
|
-
}],
|
|
245
|
-
// collisions
|
|
246
|
-
'prefer-promise-reject-errors': 'off',
|
|
247
|
-
'consistent-return': 'off'
|
|
248
|
-
}),
|
|
249
|
-
// Conflicts with @typescript-eslint
|
|
250
|
-
'no-unused-private-class-members': 'off',
|
|
251
|
-
'no-empty-function': 'off',
|
|
252
|
-
'default-case': 'off',
|
|
253
|
-
'import/named': 'off',
|
|
254
|
-
'import/namespace': 'off',
|
|
255
|
-
'import/default': 'off',
|
|
256
|
-
'import/no-named-as-default-member': 'off',
|
|
257
|
-
'camelcase': 'off',
|
|
258
|
-
'default-param-last': 'off',
|
|
259
|
-
'init-declarations': 'off',
|
|
260
|
-
'no-invalid-this': 'off',
|
|
261
|
-
'no-loop-func': 'off',
|
|
262
|
-
'no-redeclare': 'off',
|
|
263
|
-
'no-restricted-imports': 'off',
|
|
264
|
-
'no-shadow': 'off',
|
|
265
|
-
'no-unused-vars': 'off',
|
|
266
|
-
'no-use-before-define': 'off',
|
|
267
|
-
'no-useless-constructor': 'off',
|
|
268
|
-
'dot-notation': 'off',
|
|
269
|
-
'no-throw-literal': 'off',
|
|
270
|
-
'require-await': 'off',
|
|
271
|
-
'no-undef': 'off',
|
|
272
|
-
'no-duplicate-imports': 'off'
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(typescriptConfig, overrides);
|
|
276
|
-
}
|
|
277
|
-
module.exports = typescript;
|
package/cjs/modules/vitest.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _eslintPlugin = _interopRequireDefault(require("@vitest/eslint-plugin"));
|
|
8
|
-
var _eslintFlatConfigUtils = require("eslint-flat-config-utils");
|
|
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 vitest(options = {}) {
|
|
17
|
-
const overrides = (0, _objectOrEmpty.objectOrEmpty)(options.vitest.overrides);
|
|
18
|
-
const vitestConfig = {
|
|
19
|
-
name: 'vitest',
|
|
20
|
-
files: _globs.globs.test,
|
|
21
|
-
plugins: {
|
|
22
|
-
vitest: _eslintPlugin.default
|
|
23
|
-
},
|
|
24
|
-
languageOptions: {
|
|
25
|
-
globals: {
|
|
26
|
-
suite: 'writable',
|
|
27
|
-
test: 'writable',
|
|
28
|
-
describe: 'writable',
|
|
29
|
-
it: 'writable',
|
|
30
|
-
expectTypeOf: 'writable',
|
|
31
|
-
assertType: 'writable',
|
|
32
|
-
expect: 'writable',
|
|
33
|
-
assert: 'writable',
|
|
34
|
-
chai: 'writable',
|
|
35
|
-
vitest: 'writable',
|
|
36
|
-
vi: 'writable',
|
|
37
|
-
beforeAll: 'writable',
|
|
38
|
-
afterAll: 'writable',
|
|
39
|
-
beforeEach: 'writable',
|
|
40
|
-
afterEach: 'writable',
|
|
41
|
-
onTestFailed: 'writable',
|
|
42
|
-
onTestFinished: 'writable'
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
rules: {
|
|
46
|
-
'vitest/consistent-test-filename': 'off',
|
|
47
|
-
'vitest/consistent-test-it': 'warn',
|
|
48
|
-
'vitest/consistent-vitest-vi': 'warn',
|
|
49
|
-
'vitest/expect-expect': 'warn',
|
|
50
|
-
'vitest/max-expects': 'off',
|
|
51
|
-
'vitest/max-nested-describe': 'off',
|
|
52
|
-
'vitest/no-alias-methods': 'off',
|
|
53
|
-
'vitest/no-commented-out-tests': 'warn',
|
|
54
|
-
'vitest/no-conditional-expect': 'warn',
|
|
55
|
-
'vitest/no-conditional-in-test': 'off',
|
|
56
|
-
'vitest/no-conditional-tests': 'warn',
|
|
57
|
-
'vitest/no-disabled-tests': 'warn',
|
|
58
|
-
'vitest/no-duplicate-hooks': 'error',
|
|
59
|
-
'vitest/no-focused-tests': 'warn',
|
|
60
|
-
'vitest/no-hooks': 'off',
|
|
61
|
-
'vitest/no-identical-title': 'error',
|
|
62
|
-
'vitest/no-import-node-test': 'error',
|
|
63
|
-
'vitest/no-importing-vitest-globals': 'off',
|
|
64
|
-
'vitest/no-interpolation-in-snapshots': 'warn',
|
|
65
|
-
'vitest/no-large-snapshots': 'warn',
|
|
66
|
-
'vitest/no-mocks-import': 'warn',
|
|
67
|
-
'vitest/no-restricted-matchers': 'warn',
|
|
68
|
-
'vitest/no-restricted-vi-methods': 'warn',
|
|
69
|
-
'vitest/no-standalone-expect': 'warn',
|
|
70
|
-
'vitest/no-test-prefixes': 'warn',
|
|
71
|
-
'vitest/no-test-return-statement': 'warn',
|
|
72
|
-
'vitest/no-unneeded-async-expect-function': 'warn',
|
|
73
|
-
'vitest/prefer-called-once': 'warn',
|
|
74
|
-
'vitest/prefer-called-times': 'off',
|
|
75
|
-
'vitest/prefer-called-with': 'warn',
|
|
76
|
-
'vitest/prefer-comparison-matcher': 'warn',
|
|
77
|
-
'vitest/prefer-describe-function-title': 'off',
|
|
78
|
-
'vitest/prefer-each': 'warn',
|
|
79
|
-
'vitest/prefer-equality-matcher': 'warn',
|
|
80
|
-
'vitest/prefer-expect-assertions': 'off',
|
|
81
|
-
'vitest/prefer-expect-resolves': 'warn',
|
|
82
|
-
'vitest/prefer-hooks-in-order': 'warn',
|
|
83
|
-
'vitest/prefer-hooks-on-top': 'warn',
|
|
84
|
-
'vitest/prefer-importing-vitest-globals': 'off',
|
|
85
|
-
'vitest/prefer-lowercase-title': 'off',
|
|
86
|
-
'vitest/prefer-mock-promise-shorthand': 'warn',
|
|
87
|
-
'vitest/prefer-mock-return-shorthand': 'warn',
|
|
88
|
-
'vitest/prefer-snapshot-hint': 'warn',
|
|
89
|
-
'vitest/prefer-spy-on': 'warn',
|
|
90
|
-
'vitest/prefer-strict-boolean-matchers': 'off',
|
|
91
|
-
'vitest/prefer-strict-equal': 'off',
|
|
92
|
-
'vitest/prefer-to-be': 'warn',
|
|
93
|
-
'vitest/prefer-to-be-falsy': 'off',
|
|
94
|
-
'vitest/prefer-to-be-object': 'warn',
|
|
95
|
-
'vitest/prefer-to-be-truthy': 'off',
|
|
96
|
-
'vitest/prefer-to-contain': 'warn',
|
|
97
|
-
'vitest/prefer-to-have-length': 'warn',
|
|
98
|
-
'vitest/prefer-todo': 'warn',
|
|
99
|
-
'vitest/prefer-vi-mocked': 'warn',
|
|
100
|
-
'vitest/require-hook': 'off',
|
|
101
|
-
'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
|
|
102
|
-
'vitest/require-mock-type-parameters': 'off',
|
|
103
|
-
'vitest/require-to-throw-message': 'warn',
|
|
104
|
-
'vitest/require-top-level-describe': 'off',
|
|
105
|
-
'vitest/valid-describe-callback': 'warn',
|
|
106
|
-
'vitest/valid-expect': 'warn',
|
|
107
|
-
'vitest/valid-expect-in-promise': 'warn',
|
|
108
|
-
'vitest/valid-title': ['warn', {
|
|
109
|
-
allowArguments: true
|
|
110
|
-
}],
|
|
111
|
-
'vitest/warn-todo': 'warn'
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
return (0, _eslintFlatConfigUtils.mergeConfigs)(vitestConfig, overrides);
|
|
115
|
-
}
|
|
116
|
-
module.exports = vitest;
|