@fullstacksjs/eslint-config 10.11.1 → 11.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/LICENSE +1 -1
- package/README.md +6 -4
- package/package.json +27 -50
- package/src/index.js +86 -0
- package/src/init.d.ts +21 -0
- package/src/modules/base.js +187 -0
- package/src/modules/cypress.js +23 -0
- package/{esm.js → src/modules/esm.js} +1 -1
- package/src/modules/fp.js +16 -0
- package/src/modules/graphql.js +84 -0
- package/src/modules/ignores.js +39 -0
- package/src/modules/imports.js +100 -0
- package/src/modules/jest.js +74 -0
- package/src/modules/next.js +32 -0
- package/src/modules/node.js +33 -0
- package/src/modules/prettier.js +93 -0
- package/src/modules/promise.js +27 -0
- package/src/modules/react.js +151 -0
- package/src/modules/storybook.js +34 -0
- package/src/modules/strict.js +16 -0
- package/src/modules/tailwind.js +19 -0
- package/src/modules/tests.js +43 -0
- package/src/modules/typescript.js +255 -0
- package/src/modules/vitest.js +84 -0
- package/src/utils/conditions.js +20 -0
- package/src/utils/globs.js +40 -0
- package/base.js +0 -246
- package/cypress.js +0 -31
- package/expensive-rules.js +0 -4
- package/fp.js +0 -23
- package/graphql.js +0 -79
- package/import.js +0 -64
- package/index.js +0 -20
- package/init.d.ts +0 -22
- package/init.js +0 -64
- package/jest.js +0 -80
- package/next.js +0 -27
- package/node.js +0 -43
- package/prettier.js +0 -8
- package/promise.js +0 -21
- package/react.js +0 -147
- package/registerOpts.js +0 -20
- package/storybook.js +0 -31
- package/strict.js +0 -15
- package/tailwind.js +0 -15
- package/test.js +0 -40
- package/typecheck.js +0 -89
- package/typescript.js +0 -169
- package/utils.js +0 -21
- /package/{naming-convention.js → src/utils/naming-convention.js} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -53,15 +53,17 @@ When auto module detection is turned on, the configuration reads the metadata fr
|
|
|
53
53
|
|
|
54
54
|
```typescript
|
|
55
55
|
interface Modules {
|
|
56
|
-
auto?: boolean; // Auto module detection
|
|
57
56
|
react?: boolean; // controls react, react-hooks, jsx/a11y plugins
|
|
58
57
|
typescript?: { // controls typescript plugin
|
|
59
|
-
|
|
60
|
-
resolverProject?: string[] | string // controls settings['import/resolver'].typescript.project
|
|
58
|
+
projects?: boolean | string[] | string; // controls parserOptions.project
|
|
61
59
|
};
|
|
62
60
|
node?: boolean; // controls node plugin
|
|
63
61
|
strict?: boolean; // controls strict plugin
|
|
64
|
-
import?:
|
|
62
|
+
import?: {
|
|
63
|
+
projects?: string[] | string // controls settings['import/resolver'].typescript.project
|
|
64
|
+
internalRegExp?: string;
|
|
65
|
+
lifetime?: number;
|
|
66
|
+
}; // controls import plugin
|
|
65
67
|
esm?: boolean; // controls esm plugin
|
|
66
68
|
graphql?: boolean; // controls graphql plugin
|
|
67
69
|
test?: boolean; // controls jest/vitest plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -12,85 +12,62 @@
|
|
|
12
12
|
"registry": "https://registry.npmjs.org"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"
|
|
16
|
-
"cypress.js",
|
|
17
|
-
"esm.js",
|
|
18
|
-
"fp.js",
|
|
19
|
-
"graphql.js",
|
|
20
|
-
"import.js",
|
|
21
|
-
"index.d.ts",
|
|
22
|
-
"init.d.ts",
|
|
23
|
-
"init.js",
|
|
24
|
-
"jest.js",
|
|
25
|
-
"naming-convention.js",
|
|
26
|
-
"next.js",
|
|
27
|
-
"node.js",
|
|
28
|
-
"packages.js",
|
|
29
|
-
"prettier.js",
|
|
30
|
-
"expensive-rules.js",
|
|
31
|
-
"promise.js",
|
|
32
|
-
"react.js",
|
|
33
|
-
"registerOpts.js",
|
|
34
|
-
"storybook.js",
|
|
35
|
-
"strict.js",
|
|
36
|
-
"tailwind.js",
|
|
37
|
-
"test.js",
|
|
38
|
-
"typecheck.js",
|
|
39
|
-
"typescript.js",
|
|
40
|
-
"utils.js"
|
|
15
|
+
"src"
|
|
41
16
|
],
|
|
42
17
|
"scripts": {
|
|
43
18
|
"lint": "eslint .",
|
|
44
19
|
"spell": "cspell ./* --no-progress",
|
|
45
|
-
"test": "
|
|
20
|
+
"test": "echo 0",
|
|
46
21
|
"prepublishOnly": "pinst --disable",
|
|
47
22
|
"postpublish": "pinst --enable",
|
|
48
23
|
"pre-commit": "npm run test && lint-staged"
|
|
49
24
|
},
|
|
50
|
-
"main": "index.js",
|
|
25
|
+
"main": "src/index.js",
|
|
51
26
|
"dependencies": {
|
|
52
27
|
"@graphql-eslint/eslint-plugin": "3.20.1",
|
|
53
|
-
"
|
|
54
|
-
"@typescript-eslint/parser": "7.1.0",
|
|
28
|
+
"typescript-eslint": "rc-v8",
|
|
55
29
|
"deepmerge": "4.3.1",
|
|
56
|
-
"eslint-config-next": "14.1.1",
|
|
57
|
-
"eslint-config-prettier": "9.1.0",
|
|
58
30
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
59
|
-
"eslint-plugin-cypress": "
|
|
60
|
-
"eslint-plugin-
|
|
61
|
-
"eslint-plugin-import": "
|
|
62
|
-
"eslint-plugin-jest": "
|
|
31
|
+
"eslint-plugin-cypress": "3.3.0",
|
|
32
|
+
"eslint-plugin-functional": "6.5.1",
|
|
33
|
+
"eslint-plugin-import-x": "0.5.1",
|
|
34
|
+
"eslint-plugin-jest": "28.6.0",
|
|
63
35
|
"eslint-plugin-jest-formatting": "3.1.0",
|
|
64
36
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
65
|
-
"eslint-plugin-
|
|
37
|
+
"eslint-plugin-n": "17.8.1",
|
|
66
38
|
"eslint-plugin-prettier": "5.1.3",
|
|
67
|
-
"eslint-plugin-promise": "6.
|
|
68
|
-
"eslint-plugin-react": "7.
|
|
69
|
-
"eslint-plugin-react-hooks": "4.6.
|
|
70
|
-
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
39
|
+
"eslint-plugin-promise": "6.2.0",
|
|
40
|
+
"eslint-plugin-react": "7.34.2",
|
|
41
|
+
"eslint-plugin-react-hooks": "4.6.2",
|
|
71
42
|
"eslint-plugin-storybook": "0.8.0",
|
|
72
|
-
"eslint-plugin-tailwindcss": "3.
|
|
73
|
-
"
|
|
43
|
+
"eslint-plugin-tailwindcss": "3.17.3",
|
|
44
|
+
"eslint-plugin-vitest": "0.5.4",
|
|
45
|
+
"globals": "15.4.0"
|
|
74
46
|
},
|
|
75
47
|
"devDependencies": {
|
|
48
|
+
"@eslint/eslintrc": "3.1.0",
|
|
49
|
+
"@eslint/js": "9.4.0",
|
|
76
50
|
"@semantic-release/github": "9.2.6",
|
|
77
51
|
"@semantic-release/npm": "11.0.3",
|
|
78
52
|
"@semantic-release/release-notes-generator": "12.1.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
53
|
+
"@types/eslint": "8.56.10",
|
|
54
|
+
"cspell": "8.8.4",
|
|
55
|
+
"eslint": "9.4.0",
|
|
81
56
|
"eslint-find-rules": "4.1.0",
|
|
82
57
|
"husky": "9.0.11",
|
|
83
|
-
"
|
|
58
|
+
"jest": "29.7.0",
|
|
59
|
+
"lint-staged": "15.2.5",
|
|
60
|
+
"local-pkg": "0.5.0",
|
|
84
61
|
"np": "10.0.0",
|
|
85
62
|
"npm-run-all": "4.1.5",
|
|
86
63
|
"pinst": "3.0.0",
|
|
87
|
-
"prettier": "3.
|
|
64
|
+
"prettier": "3.3.1",
|
|
88
65
|
"semantic-release": "23.0.2",
|
|
89
|
-
"typescript": "5.
|
|
66
|
+
"typescript": "5.4.5"
|
|
90
67
|
},
|
|
91
68
|
"peerDependencies": {
|
|
92
69
|
"cypress": ">=8",
|
|
93
|
-
"eslint": ">=
|
|
70
|
+
"eslint": ">=9",
|
|
94
71
|
"graphql": ">=15",
|
|
95
72
|
"prettier": "3",
|
|
96
73
|
"react": ">=16",
|
package/src/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const merge = require('deepmerge');
|
|
2
|
+
const { isPackageExists } = require('local-pkg');
|
|
3
|
+
const base = require('./modules/base');
|
|
4
|
+
const cypress = require('./modules/cypress');
|
|
5
|
+
const ignores = require('./modules/ignores');
|
|
6
|
+
const imports = require('./modules/imports');
|
|
7
|
+
const prettier = require('./modules/prettier');
|
|
8
|
+
const tailwind = require('./modules/tailwind');
|
|
9
|
+
// const graphql = require('./modules/graphql');
|
|
10
|
+
const fp = require('./modules/fp');
|
|
11
|
+
const node = require('./modules/node');
|
|
12
|
+
const tests = require('./modules/tests');
|
|
13
|
+
const jest = require('./modules/jest');
|
|
14
|
+
const vitest = require('./modules/vitest');
|
|
15
|
+
// const next = require('./modules/next');
|
|
16
|
+
const strict = require('./modules/strict');
|
|
17
|
+
const react = require('./modules/react');
|
|
18
|
+
const storybook = require('./modules/storybook');
|
|
19
|
+
const typescript = require('./modules/typescript');
|
|
20
|
+
|
|
21
|
+
const testPackages = ['jest', 'vitest', 'cypress', 'playwright'];
|
|
22
|
+
|
|
23
|
+
/** @type {import('./init').Options} */
|
|
24
|
+
const defaultOptions = {
|
|
25
|
+
disableExpensiveRules: false,
|
|
26
|
+
fp: true,
|
|
27
|
+
esm: false,
|
|
28
|
+
node: false,
|
|
29
|
+
strict: false,
|
|
30
|
+
import: {},
|
|
31
|
+
test: testPackages.some(p => isPackageExists(p)),
|
|
32
|
+
react: isPackageExists('react'),
|
|
33
|
+
jest: isPackageExists('jest'),
|
|
34
|
+
vitest: isPackageExists('vitest'),
|
|
35
|
+
next: isPackageExists('next'),
|
|
36
|
+
tailwind: isPackageExists('tailwindcss'),
|
|
37
|
+
graphql: isPackageExists('graphql'),
|
|
38
|
+
cypress: isPackageExists('cypress'),
|
|
39
|
+
storybook: isPackageExists('storybook'),
|
|
40
|
+
prettier: isPackageExists('prettier'),
|
|
41
|
+
typescript: isPackageExists('typescript') ? { projects: true } : false,
|
|
42
|
+
unocss: isPackageExists('unocss'),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initialize eslint config
|
|
47
|
+
*
|
|
48
|
+
* @param {import('./init').Options} initOptions
|
|
49
|
+
* @param {...(import('eslint').Linter.FlatConfig)} extend
|
|
50
|
+
* @returns {import('eslint').Linter.FlatConfig[]}
|
|
51
|
+
*/
|
|
52
|
+
function init(initOptions, ...extend) {
|
|
53
|
+
const options = merge(defaultOptions, initOptions);
|
|
54
|
+
if (options.typescript === true) {
|
|
55
|
+
options.typescript = {};
|
|
56
|
+
}
|
|
57
|
+
if (options.import === true) {
|
|
58
|
+
options.import = {};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const rules = [ignores(), base()];
|
|
62
|
+
|
|
63
|
+
if (options.fp) rules.push(fp(options));
|
|
64
|
+
if (options.import) rules.push(imports(options));
|
|
65
|
+
if (options.tailwind) rules.push(tailwind(options));
|
|
66
|
+
if (options.test) rules.push(tests(options));
|
|
67
|
+
if (options.node) rules.push(node(options));
|
|
68
|
+
if (options.jest) rules.push(jest(options));
|
|
69
|
+
if (options.vitest) rules.push(vitest(options));
|
|
70
|
+
if (options.cypress) rules.push(cypress(options));
|
|
71
|
+
if (options.react) rules.push(react(options));
|
|
72
|
+
if (options.storybook) rules.push(storybook(options));
|
|
73
|
+
if (options.typescript) rules.push(typescript(options));
|
|
74
|
+
|
|
75
|
+
// ISSUE: Waiting for FlatConfig support https://github.com/dimaMachina/graphql-eslint/issues/2178
|
|
76
|
+
// if (false && options.graphql) rules.push(graphql(options));
|
|
77
|
+
// ISSUE: Waiting for FlatConfig support https://github.com/vercel/next/issues/64409#issuecomment-2057325722
|
|
78
|
+
// if (false && options.next) rules.push(next(options));
|
|
79
|
+
|
|
80
|
+
if (options.strict) rules.push(strict(options));
|
|
81
|
+
if (options.prettier) rules.push(prettier(options));
|
|
82
|
+
|
|
83
|
+
return rules.concat(extend);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports.init = init;
|
package/src/init.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface Options {
|
|
2
|
+
react?: boolean;
|
|
3
|
+
next?: boolean;
|
|
4
|
+
tailwind?: boolean;
|
|
5
|
+
node?: boolean;
|
|
6
|
+
strict?: boolean;
|
|
7
|
+
import?: boolean | { internalRegExp?: string; lifetime?: number; projects?: string[] | string };
|
|
8
|
+
esm?: boolean;
|
|
9
|
+
fp?: boolean;
|
|
10
|
+
graphql?: boolean;
|
|
11
|
+
test?: boolean;
|
|
12
|
+
jest?: boolean;
|
|
13
|
+
vitest?: boolean;
|
|
14
|
+
cypress?: boolean;
|
|
15
|
+
storybook?: boolean;
|
|
16
|
+
prettier?: boolean;
|
|
17
|
+
typescript?: { projects: string[] | string };
|
|
18
|
+
disableExpensiveRules?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare const init: (opts: Options) => import('eslint').Linter.FlatConfig[];
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
const globals = require('globals');
|
|
2
|
+
const { strict } = require('../utils/conditions');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {{strict?: boolean}} options
|
|
6
|
+
* @return { import('eslint').Linter.FlatConfig }
|
|
7
|
+
*/
|
|
8
|
+
function base(options = {}) {
|
|
9
|
+
return {
|
|
10
|
+
languageOptions: {
|
|
11
|
+
ecmaVersion: 'latest',
|
|
12
|
+
sourceType: 'module',
|
|
13
|
+
globals: {
|
|
14
|
+
...globals.browser,
|
|
15
|
+
...globals.node,
|
|
16
|
+
...globals.es2024,
|
|
17
|
+
},
|
|
18
|
+
parserOptions: {
|
|
19
|
+
ecmaFeatures: {
|
|
20
|
+
jsx: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
rules: {
|
|
26
|
+
'accessor-pairs': 'error',
|
|
27
|
+
'array-callback-return': 'error',
|
|
28
|
+
'block-scoped-var': 'error',
|
|
29
|
+
'camelcase': ['warn', { properties: 'always' }],
|
|
30
|
+
'complexity': ['error', 14],
|
|
31
|
+
'constructor-super': 'error',
|
|
32
|
+
'default-case-last': 'error',
|
|
33
|
+
'default-case': 'error',
|
|
34
|
+
'default-param-last': 'warn',
|
|
35
|
+
'dot-notation': 'error',
|
|
36
|
+
'eqeqeq': ['error', 'smart'],
|
|
37
|
+
'for-direction': 'error',
|
|
38
|
+
'func-name-matching': 'error',
|
|
39
|
+
'func-names': 'error',
|
|
40
|
+
'getter-return': ['error', { allowImplicit: true }],
|
|
41
|
+
'guard-for-in': 'error',
|
|
42
|
+
'max-depth': ['error', 4],
|
|
43
|
+
'max-lines-per-function': ['error', 150],
|
|
44
|
+
'max-lines': ['error', { max: 2500, skipBlankLines: false, skipComments: false }],
|
|
45
|
+
'max-nested-callbacks': ['error', 7],
|
|
46
|
+
'max-params': ['error', 7],
|
|
47
|
+
'max-statements': ['error', 40],
|
|
48
|
+
'no-alert': 'error',
|
|
49
|
+
'no-array-constructor': 'error',
|
|
50
|
+
'no-await-in-loop': 'error',
|
|
51
|
+
'no-bitwise': 'error',
|
|
52
|
+
'no-caller': 'error',
|
|
53
|
+
'no-case-declarations': 'error',
|
|
54
|
+
'no-class-assign': 'error',
|
|
55
|
+
'no-compare-neg-zero': 'error',
|
|
56
|
+
'no-cond-assign': 'error',
|
|
57
|
+
'no-const-assign': 'error',
|
|
58
|
+
'no-constant-binary-expression': 'warn',
|
|
59
|
+
'no-constant-condition': 'error',
|
|
60
|
+
'no-constructor-return': 'error',
|
|
61
|
+
'no-control-regex': 'error',
|
|
62
|
+
'no-debugger': 'error',
|
|
63
|
+
'no-delete-var': 'error',
|
|
64
|
+
'no-div-regex': 'error',
|
|
65
|
+
'no-dupe-args': 'error',
|
|
66
|
+
'no-dupe-class-members': 'error',
|
|
67
|
+
'no-dupe-else-if': 'error',
|
|
68
|
+
'no-dupe-keys': 'error',
|
|
69
|
+
'no-duplicate-case': 'error',
|
|
70
|
+
'no-empty-character-class': 'error',
|
|
71
|
+
'no-empty-pattern': 'error',
|
|
72
|
+
'no-empty-static-block': 'warn',
|
|
73
|
+
'no-empty': 'error',
|
|
74
|
+
'no-eval': 'error',
|
|
75
|
+
'no-ex-assign': 'error',
|
|
76
|
+
'no-extend-native': 'error',
|
|
77
|
+
'no-extra-bind': 'error',
|
|
78
|
+
'no-extra-label': 'error',
|
|
79
|
+
'no-fallthrough': 'error',
|
|
80
|
+
'no-floating-decimal': 'error',
|
|
81
|
+
'no-func-assign': 'error',
|
|
82
|
+
'no-global-assign': 'error',
|
|
83
|
+
'no-implicit-globals': 'error',
|
|
84
|
+
'no-implied-eval': 'error',
|
|
85
|
+
'no-import-assign': 'error',
|
|
86
|
+
'no-inner-declarations': 'error',
|
|
87
|
+
'no-invalid-regexp': 'error',
|
|
88
|
+
'no-invalid-this': 'warn',
|
|
89
|
+
'no-irregular-whitespace': 'error',
|
|
90
|
+
'no-iterator': 'error',
|
|
91
|
+
'no-label-var': 'error',
|
|
92
|
+
'no-labels': 'error',
|
|
93
|
+
'no-lone-blocks': 'error',
|
|
94
|
+
'no-lonely-if': 'error',
|
|
95
|
+
'no-loop-func': 'error',
|
|
96
|
+
'no-loss-of-precision': 'warn',
|
|
97
|
+
'no-multi-assign': 'error',
|
|
98
|
+
'no-multi-str': 'error',
|
|
99
|
+
'no-new-func': 'error',
|
|
100
|
+
'no-new-native-nonconstructor': 'error',
|
|
101
|
+
'no-new-wrappers': 'error',
|
|
102
|
+
'no-new': 'error',
|
|
103
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
104
|
+
'no-obj-calls': 'error',
|
|
105
|
+
'no-object-constructor': 'error',
|
|
106
|
+
'no-octal-escape': 'error',
|
|
107
|
+
'no-octal': 'error',
|
|
108
|
+
'no-promise-executor-return': 'error',
|
|
109
|
+
'no-proto': 'error',
|
|
110
|
+
'no-redeclare': 'error',
|
|
111
|
+
'no-regex-spaces': 'error',
|
|
112
|
+
'no-restricted-globals': ['error', { name: 'event', message: 'Use local parameter instead.' }],
|
|
113
|
+
'no-restricted-syntax': ['error', 'WithStatement'],
|
|
114
|
+
'no-return-assign': 'error',
|
|
115
|
+
'no-return-await': 'error',
|
|
116
|
+
'no-script-url': 'error',
|
|
117
|
+
'no-self-assign': 'error',
|
|
118
|
+
'no-self-compare': 'error',
|
|
119
|
+
'no-sequences': 'error',
|
|
120
|
+
'no-setter-return': 'error',
|
|
121
|
+
'no-shadow-restricted-names': 'error',
|
|
122
|
+
'no-shadow': 'error',
|
|
123
|
+
'no-sparse-arrays': 'error',
|
|
124
|
+
'no-this-before-super': 'error',
|
|
125
|
+
'no-throw-literal': 'error',
|
|
126
|
+
'no-undef-init': 'error',
|
|
127
|
+
'no-undef': 'error',
|
|
128
|
+
'no-unexpected-multiline': 'error',
|
|
129
|
+
'no-unmodified-loop-condition': 'error',
|
|
130
|
+
'no-unneeded-ternary': 'error',
|
|
131
|
+
'no-unreachable-loop': 'error',
|
|
132
|
+
'no-unreachable': 'error',
|
|
133
|
+
'no-unsafe-finally': 'error',
|
|
134
|
+
'no-unsafe-negation': 'error',
|
|
135
|
+
'no-unsafe-optional-chaining': 'error',
|
|
136
|
+
'no-unused-labels': 'error',
|
|
137
|
+
'no-unused-private-class-members': 'warn',
|
|
138
|
+
'no-unused-vars': [
|
|
139
|
+
'error',
|
|
140
|
+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^ignore(d)?', args: 'after-used', ignoreRestSiblings: true },
|
|
141
|
+
],
|
|
142
|
+
'no-use-before-define': ['error', 'nofunc'],
|
|
143
|
+
'no-useless-backreference': 'error',
|
|
144
|
+
'no-useless-call': 'error',
|
|
145
|
+
'no-useless-catch': 'error',
|
|
146
|
+
'no-useless-computed-key': 'error',
|
|
147
|
+
'no-useless-concat': 'error',
|
|
148
|
+
'no-useless-constructor': 'error',
|
|
149
|
+
'no-useless-escape': 'error',
|
|
150
|
+
'no-useless-rename': 'error',
|
|
151
|
+
'no-useless-return': 'error',
|
|
152
|
+
'no-var': 'warn',
|
|
153
|
+
'no-warning-comments': ['warn', { terms: ['fixme'], location: 'anywhere' }],
|
|
154
|
+
'object-shorthand': ['error', 'properties'],
|
|
155
|
+
'one-var': ['error', { uninitialized: 'never', initialized: 'never' }],
|
|
156
|
+
'prefer-arrow-callback': ['warn', { allowNamedFunctions: true, allowUnboundThis: true }],
|
|
157
|
+
'prefer-const': 'warn',
|
|
158
|
+
'prefer-exponentiation-operator': 'warn',
|
|
159
|
+
'prefer-numeric-literals': 'error',
|
|
160
|
+
'prefer-object-has-own': 'warn',
|
|
161
|
+
'prefer-rest-params': 'error',
|
|
162
|
+
'prefer-spread': 'error',
|
|
163
|
+
'prefer-template': 'error',
|
|
164
|
+
'radix': 'error',
|
|
165
|
+
'require-await': 'error',
|
|
166
|
+
'require-yield': 'error',
|
|
167
|
+
'strict': 'error',
|
|
168
|
+
'symbol-description': 'error',
|
|
169
|
+
'use-isnan': 'error',
|
|
170
|
+
'valid-typeof': 'error',
|
|
171
|
+
'vars-on-top': 'error',
|
|
172
|
+
'yoda': 'error',
|
|
173
|
+
|
|
174
|
+
'require-atomic-updates': 'warn',
|
|
175
|
+
'no-async-promise-executor': 'warn',
|
|
176
|
+
'grouped-accessor-pairs': 'warn',
|
|
177
|
+
'no-extra-boolean-cast': 'warn',
|
|
178
|
+
'no-param-reassign': 'warn',
|
|
179
|
+
'prefer-regex-literals': ['warn', { disallowRedundantWrapping: true }],
|
|
180
|
+
|
|
181
|
+
'no-console': strict(options, 'off'),
|
|
182
|
+
'no-empty-function': strict(options, 'off'),
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
module.exports = base;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const plugin = require('eslint-plugin-cypress/flat');
|
|
2
|
+
const { globs } = require('../utils/globs');
|
|
3
|
+
|
|
4
|
+
/** @return { import('eslint').Linter.FlatConfig } */
|
|
5
|
+
function cypress() {
|
|
6
|
+
return {
|
|
7
|
+
files: globs.e2e,
|
|
8
|
+
plugins: { cypress: plugin },
|
|
9
|
+
rules: {
|
|
10
|
+
'cypress/assertion-before-screenshot': 'warn',
|
|
11
|
+
'cypress/no-assigning-return-values': 'error',
|
|
12
|
+
'cypress/no-async-tests': 'error',
|
|
13
|
+
'cypress/no-force': 'warn',
|
|
14
|
+
'cypress/no-pause': 'error',
|
|
15
|
+
'cypress/no-unnecessary-waiting': 'error',
|
|
16
|
+
'cypress/require-data-selectors': 'off',
|
|
17
|
+
'cypress/unsafe-to-chain-command': 'error',
|
|
18
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = cypress;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const plugin = require('eslint-plugin-functional/flat');
|
|
2
|
+
|
|
3
|
+
/** @return { import('eslint').Linter.FlatConfig } */
|
|
4
|
+
function fp() {
|
|
5
|
+
return {
|
|
6
|
+
plugins: { functional: plugin },
|
|
7
|
+
rules: {
|
|
8
|
+
'functional/functional-parameters': 'off',
|
|
9
|
+
'functional/no-let': ['error', { allowInForLoopInit: true }],
|
|
10
|
+
'functional/no-loop-statements': 'error',
|
|
11
|
+
'functional/immutable-data': ['error', { ignoreClasses: true, ignoreImmediateMutation: true, ignoreNonConstDeclarations: true }],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
module.exports = fp;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const plugin = require('@graphql-eslint/eslint-plugin');
|
|
2
|
+
const globs = require('../utils/globs');
|
|
3
|
+
|
|
4
|
+
plugin.configs['schema-recommended'].parser;
|
|
5
|
+
|
|
6
|
+
/** @return { import('eslint').Linter.FlatConfig } */
|
|
7
|
+
function graphql() {
|
|
8
|
+
return {
|
|
9
|
+
files: globs.globs.graphql,
|
|
10
|
+
plugins: { graphql: plugin },
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parser: plugin.configs['schema-recommended'].parser,
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
'@graphql-eslint/alphabetize': ['warn', { fields: ['ObjectTypeDefinition'] }],
|
|
16
|
+
'@graphql-eslint/description-style': 'warn',
|
|
17
|
+
'@graphql-eslint/executable-definitions': 'off',
|
|
18
|
+
'@graphql-eslint/fields-on-correct-type': 'warn',
|
|
19
|
+
'@graphql-eslint/fragments-on-composite-type': 'warn',
|
|
20
|
+
'@graphql-eslint/input-name': 'warn',
|
|
21
|
+
'@graphql-eslint/known-argument-names': 'warn',
|
|
22
|
+
'@graphql-eslint/known-directives': 'warn',
|
|
23
|
+
'@graphql-eslint/known-fragment-names': 'warn',
|
|
24
|
+
'@graphql-eslint/known-type-names': 'warn',
|
|
25
|
+
'@graphql-eslint/lone-anonymous-operation': 'warn',
|
|
26
|
+
'@graphql-eslint/lone-executable-definition': 'off',
|
|
27
|
+
'@graphql-eslint/lone-schema-definition': 'warn',
|
|
28
|
+
'@graphql-eslint/match-document-filename': ['warn', { query: 'camelCase', mutation: 'camelCase', subscription: 'camelCase' }],
|
|
29
|
+
'@graphql-eslint/naming-convention': 'warn',
|
|
30
|
+
'@graphql-eslint/no-anonymous-operations': 'warn',
|
|
31
|
+
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'warn',
|
|
32
|
+
'@graphql-eslint/no-deprecated': 'warn',
|
|
33
|
+
'@graphql-eslint/no-duplicate-fields': 'warn',
|
|
34
|
+
'@graphql-eslint/no-fragment-cycles': 'warn',
|
|
35
|
+
'@graphql-eslint/no-hashtag-description': 'warn',
|
|
36
|
+
'@graphql-eslint/no-one-place-fragments': 'off',
|
|
37
|
+
'@graphql-eslint/no-root-type': 'off',
|
|
38
|
+
'@graphql-eslint/no-scalar-result-type-on-mutation': 'warn',
|
|
39
|
+
'@graphql-eslint/no-typename-prefix': 'warn',
|
|
40
|
+
'@graphql-eslint/no-undefined-variables': 'warn',
|
|
41
|
+
'@graphql-eslint/no-unreachable-types': 'warn',
|
|
42
|
+
'@graphql-eslint/no-unused-fields': 'warn',
|
|
43
|
+
'@graphql-eslint/no-unused-fragments': 'warn',
|
|
44
|
+
'@graphql-eslint/no-unused-variables': 'warn',
|
|
45
|
+
'@graphql-eslint/one-field-subscriptions': 'warn',
|
|
46
|
+
'@graphql-eslint/overlapping-fields-can-be-merged': 'warn',
|
|
47
|
+
'@graphql-eslint/possible-fragment-spread': 'warn',
|
|
48
|
+
'@graphql-eslint/possible-type-extension': 'warn',
|
|
49
|
+
'@graphql-eslint/provided-required-arguments': 'warn',
|
|
50
|
+
'@graphql-eslint/relay-arguments': 'warn',
|
|
51
|
+
'@graphql-eslint/relay-connection-types': 'warn',
|
|
52
|
+
'@graphql-eslint/relay-edge-types': 'warn',
|
|
53
|
+
'@graphql-eslint/relay-page-info': 'warn',
|
|
54
|
+
'@graphql-eslint/require-deprecation-date': 'warn',
|
|
55
|
+
'@graphql-eslint/require-deprecation-reason': 'warn',
|
|
56
|
+
'@graphql-eslint/require-description': 'off',
|
|
57
|
+
'@graphql-eslint/require-field-of-type-query-in-mutation-result': 'warn',
|
|
58
|
+
'@graphql-eslint/require-id-when-available': 'warn',
|
|
59
|
+
'@graphql-eslint/require-import-fragment': 'off',
|
|
60
|
+
'@graphql-eslint/require-nullable-fields-with-oneof': 'warn',
|
|
61
|
+
'@graphql-eslint/require-nullable-result-in-root': 'off',
|
|
62
|
+
'@graphql-eslint/require-type-pattern-with-oneof': 'warn',
|
|
63
|
+
'@graphql-eslint/scalar-leafs': 'warn',
|
|
64
|
+
'@graphql-eslint/selection-set-depth': 'off',
|
|
65
|
+
'@graphql-eslint/strict-id-in-types': 'warn',
|
|
66
|
+
'@graphql-eslint/unique-argument-names': 'warn',
|
|
67
|
+
'@graphql-eslint/unique-directive-names-per-location': 'warn',
|
|
68
|
+
'@graphql-eslint/unique-directive-names': 'warn',
|
|
69
|
+
'@graphql-eslint/unique-enum-value-names': 'warn',
|
|
70
|
+
'@graphql-eslint/unique-field-definition-names': 'warn',
|
|
71
|
+
'@graphql-eslint/unique-fragment-name': 'warn',
|
|
72
|
+
'@graphql-eslint/unique-input-field-names': 'warn',
|
|
73
|
+
'@graphql-eslint/unique-operation-name': 'warn',
|
|
74
|
+
'@graphql-eslint/unique-operation-types': 'warn',
|
|
75
|
+
'@graphql-eslint/unique-type-names': 'warn',
|
|
76
|
+
'@graphql-eslint/unique-variable-names': 'warn',
|
|
77
|
+
'@graphql-eslint/value-literals-of-correct-type': 'warn',
|
|
78
|
+
'@graphql-eslint/variables-are-input-types': 'warn',
|
|
79
|
+
'@graphql-eslint/variables-in-allowed-position': 'warn',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = graphql;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @return { import('eslint').Linter.FlatConfig } */
|
|
2
|
+
function ignores() {
|
|
3
|
+
return {
|
|
4
|
+
name: 'fullstacksjs/ignores',
|
|
5
|
+
ignores: [
|
|
6
|
+
'**/node_modules',
|
|
7
|
+
'**/dist',
|
|
8
|
+
'**/package-lock.json',
|
|
9
|
+
'**/yarn.lock',
|
|
10
|
+
'**/pnpm-lock.yaml',
|
|
11
|
+
'**/bun.lockb',
|
|
12
|
+
|
|
13
|
+
'**/output',
|
|
14
|
+
'**/coverage',
|
|
15
|
+
'**/temp',
|
|
16
|
+
'**/.temp',
|
|
17
|
+
'**/tmp',
|
|
18
|
+
'**/.tmp',
|
|
19
|
+
'**/.nx',
|
|
20
|
+
'**/.history',
|
|
21
|
+
'**/.vitepress/cache',
|
|
22
|
+
'**/.nuxt',
|
|
23
|
+
'**/.next',
|
|
24
|
+
'**/.vercel',
|
|
25
|
+
'**/.changeset',
|
|
26
|
+
'**/.idea',
|
|
27
|
+
'**/.cache',
|
|
28
|
+
'**/.output',
|
|
29
|
+
'**/.vite-inspect',
|
|
30
|
+
'**/.yarn',
|
|
31
|
+
'**/LICENSE*',
|
|
32
|
+
'**/*.min.*',
|
|
33
|
+
|
|
34
|
+
'**/__snapshots__',
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = ignores;
|