@ornikar/eslint-config 22.7.4 → 23.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/.eslintrc.json +4 -0
- package/CHANGELOG.md +7 -613
- package/README.md +33 -62
- package/_shared.js +11 -9
- package/graphql.js +10 -12
- package/index.js +16 -24
- package/node-module-override.js +6 -12
- package/node.js +3 -5
- package/package.json +3 -4
- package/rollup.js +5 -9
- package/root.js +14 -17
- package/rules/best-practices.js +9 -11
- package/rules/imports.js +8 -10
- package/rules/jest.js +7 -13
- package/rules/node-override.js +23 -25
- package/rules/node.js +32 -28
- package/rules/ornikar.js +4 -8
- package/rules/prettier.js +10 -13
- package/rules/security.js +19 -21
- package/rules/sort-imports-exports.js +11 -15
- package/rules/style.js +31 -33
- package/rules/unicorn.js +214 -218
- package/tests-override.js +18 -17
package/README.md
CHANGED
|
@@ -15,105 +15,76 @@ Also see:
|
|
|
15
15
|
|
|
16
16
|
## How to install
|
|
17
17
|
|
|
18
|
-
These configs ship as flat-config arrays. Require the subpath you need and spread it into your `eslint.config.js`.
|
|
19
|
-
|
|
20
18
|
### root
|
|
21
19
|
|
|
22
20
|
1. `npm install --save-dev eslint @ornikar/eslint-config`
|
|
23
|
-
2.
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
const ornikarRoot = require('@ornikar/eslint-config/root');
|
|
27
|
-
|
|
28
|
-
module.exports = [...ornikarRoot];
|
|
29
|
-
```
|
|
21
|
+
2. Add `"extends": ["@ornikar/eslint-config/root"]` to your eslint config
|
|
30
22
|
|
|
31
23
|
### node without babel or typescript
|
|
32
24
|
|
|
33
25
|
1. `npm install --save-dev eslint @ornikar/eslint-config`
|
|
34
|
-
2.
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
const ornikarNode = require('@ornikar/eslint-config/node');
|
|
38
|
-
|
|
39
|
-
module.exports = [...ornikarNode];
|
|
40
|
-
```
|
|
26
|
+
2. Add `"extends": ["@ornikar/eslint-config", "@ornikar/eslint-config/node"]` to your eslint config
|
|
41
27
|
|
|
42
28
|
### node with babel (deprecated, please use typescript instead)
|
|
43
29
|
|
|
44
30
|
1. `npm install --save-dev eslint @ornikar/eslint-config @ornikar/eslint-config-babel`
|
|
45
|
-
2.
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
const babelConfig = require('@ornikar/eslint-config-babel');
|
|
49
|
-
|
|
50
|
-
module.exports = [...babelConfig];
|
|
51
|
-
```
|
|
31
|
+
2. Add `"extends": ["@ornikar/eslint-config-babel", "@ornikar/eslint-config/node""]` to your eslint config
|
|
52
32
|
|
|
53
33
|
### node with typescript
|
|
54
34
|
|
|
55
35
|
1. `npm install --save-dev eslint @ornikar/eslint-config @ornikar/eslint-config-typescript`
|
|
56
|
-
2.
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
const tsNode = require('@ornikar/eslint-config-typescript/node');
|
|
60
|
-
|
|
61
|
-
module.exports = [...tsNode];
|
|
62
|
-
```
|
|
36
|
+
2. Add `"extends": ["@ornikar/eslint-config-typescript", "@ornikar/eslint-config/node"]` to your eslint config
|
|
63
37
|
|
|
64
38
|
### module override
|
|
65
39
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
extends: [nodeModuleOverride],
|
|
78
|
-
},
|
|
79
|
-
]);
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"root": true,
|
|
43
|
+
"extends": ["@ornikar/eslint-config/root"],
|
|
44
|
+
"overrides": [
|
|
45
|
+
{
|
|
46
|
+
"files": ["test-setup.js"],
|
|
47
|
+
"extends": ["@ornikar/eslint-config/node-module-override"]
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
80
51
|
```
|
|
81
52
|
|
|
82
53
|
## How to configure a project
|
|
83
54
|
|
|
84
|
-
### Two
|
|
55
|
+
### Two configurations files
|
|
85
56
|
|
|
86
|
-
In a project you should have two
|
|
57
|
+
In a project you should have two configurations files:
|
|
87
58
|
|
|
88
|
-
-
|
|
89
|
-
- /{src,lib}
|
|
59
|
+
- /.eslintrc.json
|
|
60
|
+
- /{src,lib}/.eslintrc.json
|
|
90
61
|
|
|
91
62
|
If the project is compiled, use `src` for source and `dist` for compilation with rollup.
|
|
92
63
|
If the project is not compiled, use `lib`.
|
|
93
|
-
If the project is CRA, next or
|
|
64
|
+
If the project is CRA, next or build with webpack, use `src` for source and `build` or the build directory your tool uses.
|
|
94
65
|
|
|
95
66
|
Using two config files is important:
|
|
96
67
|
|
|
97
|
-
- the root
|
|
98
|
-
- the source
|
|
68
|
+
- the root eslintrc is for config files and scripts. It should allow dev dependencies
|
|
69
|
+
- the source eslintrc is for your source and tests files.
|
|
99
70
|
|
|
100
|
-
|
|
71
|
+
### Use `"root": true`
|
|
101
72
|
|
|
102
|
-
|
|
73
|
+
Both the configuration shoud set `"root": true` to prevent eslint to merge the config file with other higher eslintrc configs. See [Cascading and hierarchy](https://eslint.org/docs/user-guide/configuring/configuration-files#cascading-and-hierarchy) in eslint config documentation.
|
|
103
74
|
|
|
104
|
-
|
|
75
|
+
The advantage of using 2 config files is to avoid overriding rules set for root. For example, root config should use plugin node, but not always your source config !
|
|
105
76
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
77
|
+
### Use `ignorePatterns` in .eslintrc.json
|
|
78
|
+
|
|
79
|
+
Use `ignorePatterns` instead of .eslintignore file. We have enough configuration files !
|
|
109
80
|
|
|
110
81
|
### Use `--report-unused-disable-directives`
|
|
111
82
|
|
|
112
|
-
Really
|
|
83
|
+
Really usefull tip, it prevents leaving unused eslint-disable directives.
|
|
113
84
|
|
|
114
|
-
### Lerna/Workspaces
|
|
85
|
+
### Lerna/Workspaces Configuration
|
|
115
86
|
|
|
116
|
-
Assuming your
|
|
87
|
+
Assuming your package.json looks like `"workspaces": ["packages/*"]`:
|
|
117
88
|
|
|
118
|
-
-
|
|
119
|
-
- /packages/\*/{src,lib}
|
|
89
|
+
- /.eslintrc.json
|
|
90
|
+
- /packages/\*/{src,lib}/.eslintrc.json
|
package/_shared.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: [
|
|
5
|
+
'./rules/best-practices',
|
|
6
|
+
'./rules/ornikar',
|
|
7
|
+
'./rules/imports',
|
|
8
|
+
'./rules/style',
|
|
9
|
+
'./rules/sort-imports-exports',
|
|
10
|
+
'./rules/security',
|
|
11
|
+
'./rules/unicorn',
|
|
12
|
+
].map(require.resolve),
|
|
13
|
+
};
|
package/graphql.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
4
|
-
{
|
|
5
|
-
rules
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
],
|
|
13
|
-
},
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
// https://eslint.org/docs/rules/no-underscore-dangle
|
|
6
|
+
'no-underscore-dangle': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
allow: ['__typename'],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
14
12
|
},
|
|
15
|
-
|
|
13
|
+
};
|
package/index.js
CHANGED
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const prettierConfig = require('./rules/prettier');
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ['eslint-config-airbnb-base', './_shared', './rules/prettier'].map(require.resolve),
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
parserOptions: {
|
|
7
|
+
sourceType: 'script',
|
|
8
|
+
ecmaVersion: 2021,
|
|
9
|
+
},
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rules: {
|
|
19
|
-
strict: ['error', 'safe'],
|
|
20
|
-
'import/extensions': [
|
|
21
|
-
'error',
|
|
22
|
-
'ignorePackages',
|
|
23
|
-
{
|
|
24
|
-
js: 'never',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
11
|
+
rules: {
|
|
12
|
+
strict: ['error', 'safe'],
|
|
13
|
+
'import/extensions': [
|
|
14
|
+
'error',
|
|
15
|
+
'ignorePackages',
|
|
16
|
+
{
|
|
17
|
+
js: 'never',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
28
20
|
},
|
|
29
|
-
|
|
21
|
+
};
|
package/node-module-override.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const nPlugin = require('eslint-plugin-n');
|
|
4
|
-
const nodeOverride = require('./rules/node-override');
|
|
5
|
-
|
|
6
3
|
/* prefer usage of .mjs files over this override */
|
|
7
|
-
module.exports =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// top level await is introduced in ecmaVersion: 2022 but supported since node 14
|
|
13
|
-
ecmaVersion: 2022,
|
|
14
|
-
},
|
|
4
|
+
module.exports = {
|
|
5
|
+
extends: ['plugin:n/recommended-module', require.resolve('./rules/node-override')],
|
|
6
|
+
parserOptions: {
|
|
7
|
+
// top level await is introduced in ecmaVersion: 2022 but supported since node 14
|
|
8
|
+
ecmaVersion: 2022,
|
|
15
9
|
},
|
|
16
|
-
|
|
10
|
+
};
|
package/node.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
module.exports = [...indexConfig, ...nodeRules, ...prettierConfig];
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ['.', './rules/node', './rules/prettier'].map(require.resolve),
|
|
5
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornikar/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "eslint config files",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "@ornikar/eslint-config",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@eslint
|
|
20
|
-
"@ornikar/eslint-plugin-ornikar": "22.7.4",
|
|
19
|
+
"@ornikar/eslint-plugin-ornikar": "23.0.0",
|
|
21
20
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
22
21
|
"eslint-config-prettier": "^10.0.0",
|
|
23
22
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -38,6 +37,6 @@
|
|
|
38
37
|
"prettier": "2.8.8"
|
|
39
38
|
},
|
|
40
39
|
"scripts": {
|
|
41
|
-
"lint:eslint": "yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/eslint-config"
|
|
40
|
+
"lint:eslint": "ESLINT_USE_FLAT_CONFIG=false yarn ../.. eslint --report-unused-disable-directives --quiet @ornikar/eslint-config"
|
|
42
41
|
}
|
|
43
42
|
}
|
package/rollup.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// See https://github.com/ornikar/shared-configs/tree/master/%40ornikar/rollup-config
|
|
4
|
-
module.exports =
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
__DEV__: 'writable',
|
|
9
|
-
__TARGET__: 'writable',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
4
|
+
module.exports = {
|
|
5
|
+
globals: {
|
|
6
|
+
__DEV__: true,
|
|
7
|
+
__TARGET__: true,
|
|
12
8
|
},
|
|
13
|
-
|
|
9
|
+
};
|
package/root.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ['./node'].map(require.resolve),
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
devDependencies: true,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
6
|
+
rules: {
|
|
7
|
+
'no-console': 'off',
|
|
8
|
+
'import/no-extraneous-dependencies': [
|
|
9
|
+
'error',
|
|
10
|
+
{
|
|
11
|
+
devDependencies: true,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
15
|
+
// Allow non-literal fs filename for dev scripts
|
|
16
|
+
'security/detect-non-literal-fs-filename': 'off',
|
|
17
|
+
'security/detect-non-literal-require': 'off',
|
|
21
18
|
},
|
|
22
|
-
|
|
19
|
+
};
|
package/rules/best-practices.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
4
|
-
{
|
|
5
|
-
rules
|
|
6
|
-
|
|
7
|
-
'require-await': 'error',
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
// https://eslint.org/docs/rules/require-await
|
|
6
|
+
'require-await': 'error',
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
// https://eslint.org/docs/rules/no-warning-comments
|
|
9
|
+
'no-warning-comments': ['error', { terms: ['fixme', 'xxx', 'console.'], location: 'start' }],
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
11
|
+
// https://eslint.org/docs/rules/max-depth
|
|
12
|
+
'max-depth': ['warn', 6],
|
|
15
13
|
},
|
|
16
|
-
|
|
14
|
+
};
|
package/rules/imports.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
4
|
-
{
|
|
5
|
-
|
|
6
|
-
/* https://ornikar.atlassian.net/wiki/spaces/TECH/pages/2670330094/Avoid+default+export */
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
/* https://ornikar.atlassian.net/wiki/spaces/TECH/pages/2670330094/Avoid+default+export */
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
8
|
+
'import/prefer-default-export': 'off',
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
10
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-default-export.md
|
|
11
|
+
'import/no-default-export': 'error',
|
|
14
12
|
},
|
|
15
|
-
|
|
13
|
+
};
|
package/rules/jest.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
languageOptions: jestPlugin.configs['flat/recommended'].languageOptions,
|
|
10
|
-
rules: {
|
|
11
|
-
'jest/no-disabled-tests': 'error',
|
|
12
|
-
'jest/no-focused-tests': 'error',
|
|
13
|
-
'jest/prefer-called-with': 'error',
|
|
14
|
-
},
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['jest'],
|
|
5
|
+
rules: {
|
|
6
|
+
'jest/no-disabled-tests': 'error',
|
|
7
|
+
'jest/no-focused-tests': 'error',
|
|
8
|
+
'jest/prefer-called-with': 'error',
|
|
15
9
|
},
|
|
16
|
-
|
|
10
|
+
};
|
package/rules/node-override.js
CHANGED
|
@@ -2,33 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
const airbnbStyleRules = require('eslint-config-airbnb-base/rules/style');
|
|
4
4
|
|
|
5
|
-
module.exports =
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'n/no-missing-import': 'off',
|
|
5
|
+
module.exports = {
|
|
6
|
+
rules: {
|
|
7
|
+
// already checked by import plugin
|
|
8
|
+
'n/no-unpublished-require': 'off',
|
|
9
|
+
'n/no-unpublished-import': 'off',
|
|
10
|
+
'n/no-extraneous-require': 'off',
|
|
11
|
+
'n/no-extraneous-import': 'off',
|
|
12
|
+
'n/no-missing-require': 'off',
|
|
13
|
+
'n/no-missing-import': 'off',
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// Use for-of instead of for
|
|
16
|
+
'unicorn/no-for-loop': 'error',
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// allow process.exit, disallowed when not used in script via https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
|
|
19
|
+
'no-process-exit': 'off',
|
|
20
|
+
'n/no-process-exit': 'off',
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
// Allow for-of, now supported by node 6
|
|
23
|
+
'no-restricted-syntax': [
|
|
24
|
+
'error',
|
|
25
|
+
...airbnbStyleRules.rules['no-restricted-syntax']
|
|
26
|
+
.slice(1)
|
|
27
|
+
.filter(({ selector }) => selector !== 'ForOfStatement'),
|
|
28
|
+
],
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
},
|
|
30
|
+
'unicorn/prefer-at': 'error',
|
|
33
31
|
},
|
|
34
|
-
|
|
32
|
+
};
|
package/rules/node.js
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['n'],
|
|
5
|
+
extends: ['plugin:n/recommended', require.resolve('./node-override')],
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...nodeOverride,
|
|
10
|
-
{
|
|
11
|
-
languageOptions: {
|
|
12
|
-
// top level await is introduced in ecmaVersion: 2022 but supported since node 14
|
|
13
|
-
ecmaVersion: 2022,
|
|
14
|
-
},
|
|
7
|
+
parserOptions: {
|
|
8
|
+
// top level await is introduced in ecmaVersion: 2022 but supported since node 14
|
|
9
|
+
ecmaVersion: 2022,
|
|
15
10
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
|
|
12
|
+
env: {
|
|
13
|
+
browser: false,
|
|
14
|
+
node: true,
|
|
15
|
+
es6: true,
|
|
19
16
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...nPlugin.configs['flat/recommended-module'].languageOptions,
|
|
26
|
-
ecmaVersion: 2022,
|
|
17
|
+
|
|
18
|
+
overrides: [
|
|
19
|
+
{
|
|
20
|
+
files: ['*.cjs'],
|
|
21
|
+
extends: ['plugin:n/recommended-script', require.resolve('./node-override')],
|
|
27
22
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
{
|
|
24
|
+
files: ['*.mjs'],
|
|
25
|
+
extends: ['plugin:n/recommended-module', require.resolve('./node-override')],
|
|
26
|
+
parserOptions: {
|
|
27
|
+
// top level await is introduced in ecmaVersion: 2022 but supported since node 14
|
|
28
|
+
ecmaVersion: 2022,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
files: ['scripts/**'],
|
|
33
|
+
rules: {
|
|
34
|
+
'n/hashbang': 'off',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
package/rules/ornikar.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
plugins: { '@ornikar/ornikar': ornikarPlugin },
|
|
8
|
-
rules: ornikarPlugin.configs.recommended.rules,
|
|
9
|
-
},
|
|
10
|
-
];
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['@ornikar/ornikar'],
|
|
5
|
+
extends: ['plugin:@ornikar/ornikar/recommended'],
|
|
6
|
+
};
|
package/rules/prettier.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ['eslint-config-prettier'].map(require.resolve),
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// https://github.com/prettier/eslint-config-prettier#curly
|
|
10
|
-
// prettier doesn't enforce {} with multiline
|
|
11
|
-
curly: ['error', 'multi-line'],
|
|
6
|
+
rules: {
|
|
7
|
+
// https://github.com/prettier/eslint-config-prettier#curly
|
|
8
|
+
// prettier doesn't enforce {} with multiline
|
|
9
|
+
curly: ['error', 'multi-line'],
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
11
|
+
// https://github.com/prettier/eslint-config-prettier#quotes
|
|
12
|
+
// prettier doesn't change backtick to single
|
|
13
|
+
quotes: ['error', 'single', { avoidEscape: true }],
|
|
17
14
|
},
|
|
18
|
-
|
|
15
|
+
};
|