@ringieraxelspringer/eslint-config 24.3.0 → 25.0.0-alpha.6
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 +50 -31
- package/dist/configs/common.d.ts +4 -0
- package/dist/configs/common.js +52 -0
- package/dist/configs/common.js.map +1 -0
- package/dist/configs/json.d.ts +2 -0
- package/dist/configs/json.js +15 -0
- package/dist/configs/json.js.map +1 -0
- package/dist/configs/n.d.ts +1 -0
- package/dist/configs/n.js +25 -0
- package/dist/configs/n.js.map +1 -0
- package/dist/configs/react-hooks.d.ts +1 -0
- package/dist/configs/react-hooks.js +10 -0
- package/dist/configs/react-hooks.js.map +1 -0
- package/dist/configs/stylistic.d.ts +1 -0
- package/dist/configs/stylistic.js +45 -0
- package/dist/configs/stylistic.js.map +1 -0
- package/dist/configs/typescript.d.ts +1 -0
- package/dist/configs/typescript.js +30 -0
- package/dist/configs/typescript.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/package.json +24 -15
- package/CHANGELOG.md +0 -253
- package/lib/index.js +0 -157
package/README.md
CHANGED
|
@@ -4,45 +4,64 @@ Common Ringier Axel Springer ESLint configuration.
|
|
|
4
4
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- ESLint 10 (flat config)
|
|
8
|
+
- Node.js 20 or newer
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
If you use earlier version of TypeScript, you will have to use older version of this package (<7.0.0).
|
|
10
|
+
The package is ESM-only, so the config file has to be an ES module (`eslint.config.mjs`, or `eslint.config.js` in a package with `"type": "module"`).
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```shell
|
|
15
|
-
npm install --save-dev @ringieraxelspringer/eslint-config
|
|
15
|
+
npm install --save-dev eslint @ringieraxelspringer/eslint-config
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
## Usage (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@ringieraxelspringer/eslint-config": "latest"
|
|
28
|
-
},
|
|
29
|
-
"eslintConfig": {
|
|
30
|
-
"extends": "@ringieraxelspringer/eslint-config"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
18
|
+
## Usage (eslint.config.mjs)
|
|
19
|
+
|
|
20
|
+
### JavaScript/TypeScript (Node.js)
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { config } from '@ringieraxelspringer/eslint-config';
|
|
24
|
+
|
|
25
|
+
export default config();
|
|
33
26
|
```
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
### React
|
|
29
|
+
|
|
30
|
+
Adds `eslint-plugin-react-hooks` rules and skips the Node.js-specific `eslint-plugin-n` rules.
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { config } from '@ringieraxelspringer/eslint-config';
|
|
34
|
+
|
|
35
|
+
export default config({ useReact: true });
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Extending
|
|
39
|
+
|
|
40
|
+
`config()` returns a flat config array, so project-specific entries can be appended:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
import { config } from '@ringieraxelspringer/eslint-config';
|
|
44
|
+
import { defineConfig } from 'eslint/config';
|
|
45
|
+
|
|
46
|
+
export default defineConfig([
|
|
47
|
+
...config(),
|
|
48
|
+
{
|
|
49
|
+
rules: {
|
|
50
|
+
'no-console': 'off'
|
|
51
|
+
}
|
|
46
52
|
}
|
|
47
|
-
|
|
53
|
+
]);
|
|
48
54
|
```
|
|
55
|
+
|
|
56
|
+
## What is included
|
|
57
|
+
|
|
58
|
+
| Module | Files | Source |
|
|
59
|
+
|---|---|---|
|
|
60
|
+
| common | JS/TS | `@eslint/js` recommended + team rules |
|
|
61
|
+
| typescript | JS/TS | `typescript-eslint` recommended + team rules |
|
|
62
|
+
| n | JS/TS (without `useReact`) | `eslint-plugin-n` recommended |
|
|
63
|
+
| react-hooks | JS/TS (with `useReact`) | `eslint-plugin-react-hooks` recommended |
|
|
64
|
+
| stylistic | JS/TS | `@stylistic/eslint-plugin` (4 spaces, semicolons, single quotes, no dangling commas) |
|
|
65
|
+
| json | `*.json`, `*.jsonc`, `tsconfig*.json` | `@eslint/json` recommended (`package-lock.json` skipped) |
|
|
66
|
+
|
|
67
|
+
`**/dist` is ignored globally.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
export const JS_FILES = ['**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}'];
|
|
4
|
+
export const TS_FILES = ['**/*.{cts,mts,ts,tsx}'];
|
|
5
|
+
export const commonConfig = [
|
|
6
|
+
{
|
|
7
|
+
...js.configs.recommended,
|
|
8
|
+
files: JS_FILES,
|
|
9
|
+
languageOptions: {
|
|
10
|
+
ecmaVersion: 2025,
|
|
11
|
+
sourceType: 'module',
|
|
12
|
+
globals: {
|
|
13
|
+
...globals.node,
|
|
14
|
+
...globals.browser,
|
|
15
|
+
...globals.es2025,
|
|
16
|
+
...globals.jest,
|
|
17
|
+
...globals.vitest
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
linterOptions: {
|
|
21
|
+
reportUnusedDisableDirectives: 'warn',
|
|
22
|
+
reportUnusedInlineConfigs: 'warn'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
files: JS_FILES,
|
|
27
|
+
rules: {
|
|
28
|
+
'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }],
|
|
29
|
+
'curly': 'error',
|
|
30
|
+
'dot-notation': 'error',
|
|
31
|
+
'eqeqeq': ['error', 'always'],
|
|
32
|
+
'max-classes-per-file': ['warn', { ignoreExpressions: true, max: 1 }],
|
|
33
|
+
'no-alert': 'error',
|
|
34
|
+
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
|
|
35
|
+
'no-duplicate-imports': 'error',
|
|
36
|
+
'no-empty': 'error',
|
|
37
|
+
'no-empty-function': 'error',
|
|
38
|
+
'no-implicit-coercion': ['error', { boolean: true, disallowTemplateShorthand: true, number: true, string: true }],
|
|
39
|
+
'no-lonely-if': 'error',
|
|
40
|
+
'no-loop-func': 'error',
|
|
41
|
+
'no-var': 'error',
|
|
42
|
+
'object-shorthand': ['error', 'properties'],
|
|
43
|
+
'prefer-arrow-callback': 'error',
|
|
44
|
+
'prefer-const': 'error',
|
|
45
|
+
'prefer-template': 'error',
|
|
46
|
+
'require-atomic-updates': 'error',
|
|
47
|
+
'require-await': 'error',
|
|
48
|
+
'yoda': 'error'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/configs/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,sCAAsC,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAoB;IACzC;QACI,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW;QACzB,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE;YACb,WAAW,EAAE,IAAI;YACjB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE;gBACL,GAAG,OAAO,CAAC,IAAI;gBACf,GAAG,OAAO,CAAC,OAAO;gBAClB,GAAG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+
import json from '@eslint/json';
|
|
2
|
+
export const jsonConfig = [
|
|
3
|
+
{
|
|
4
|
+
...json.configs.recommended,
|
|
5
|
+
files: ['**/*.json'],
|
|
6
|
+
ignores: ['**/package-lock.json', '**/tsconfig*.json', '**/.vscode/*.json'],
|
|
7
|
+
language: 'json/json'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
...json.configs.recommended,
|
|
11
|
+
files: ['**/*.jsonc', '**/tsconfig*.json', '**/.vscode/*.json'],
|
|
12
|
+
language: 'json/jsonc'
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/configs/json.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAoB;IACvC;QACI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW;QAC3B,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;QAC3E,QAAQ,EAAE,WAAW;KACxB;IACD;QACI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW;QAC3B,KAAK,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,CAAC;QAC/D,QAAQ,EAAE,YAAY;KACzB;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nConfig: import("@eslint/config-helpers").ConfigObject[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from '@eslint/config-helpers';
|
|
2
|
+
import n from 'eslint-plugin-n';
|
|
3
|
+
import { JS_FILES, TS_FILES } from './common.js';
|
|
4
|
+
export const nConfig = defineConfig([
|
|
5
|
+
{
|
|
6
|
+
files: JS_FILES,
|
|
7
|
+
extends: [n.configs['flat/recommended']],
|
|
8
|
+
rules: {
|
|
9
|
+
'n/global-require': 'error',
|
|
10
|
+
'n/no-missing-import': 'off',
|
|
11
|
+
'n/no-process-exit': 'off',
|
|
12
|
+
'n/no-unpublished-import': 'off',
|
|
13
|
+
'n/no-unpublished-require': 'off',
|
|
14
|
+
'n/prefer-global/buffer': 'error'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
files: TS_FILES,
|
|
19
|
+
rules: {
|
|
20
|
+
'n/no-unsupported-features/es-builtins': 'off',
|
|
21
|
+
'n/no-unsupported-features/es-syntax': 'off'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]);
|
|
25
|
+
//# sourceMappingURL=n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n.js","sourceRoot":"","sources":["../../src/configs/n.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,CAAC,MAAM,iBAAiB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAChC;QACI,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACxC,KAAK,EAAE;YACH,kBAAkB,EAAE,OAAO;YAC3B,qBAAqB,EAAE,KAAK;YAC5B,mBAAmB,EAAE,KAAK;YAC1B,yBAAyB,EAAE,KAAK;YAChC,0BAA0B,EAAE,KAAK;YACjC,wBAAwB,EAAE,OAAO;SACpC;KACJ;IACD;QACI,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE;YACH,uCAAuC,EAAE,KAAK;YAC9C,qCAAqC,EAAE,KAAK;SAC/C;KACJ;CACmB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const reactHooksConfig: import("@eslint/config-helpers").ConfigObject[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from '@eslint/config-helpers';
|
|
2
|
+
import { configs } from 'eslint-plugin-react-hooks';
|
|
3
|
+
import { JS_FILES } from './common.js';
|
|
4
|
+
export const reactHooksConfig = defineConfig([
|
|
5
|
+
{
|
|
6
|
+
files: JS_FILES,
|
|
7
|
+
extends: [configs.flat.recommended]
|
|
8
|
+
}
|
|
9
|
+
]);
|
|
10
|
+
//# sourceMappingURL=react-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-hooks.js","sourceRoot":"","sources":["../../src/configs/react-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;IACzC;QACI,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;KACtC;CACmB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stylisticConfig: import("@eslint/config-helpers").ConfigObject[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineConfig } from '@eslint/config-helpers';
|
|
2
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
3
|
+
import { JS_FILES } from './common.js';
|
|
4
|
+
export const stylisticConfig = defineConfig([
|
|
5
|
+
{
|
|
6
|
+
files: JS_FILES,
|
|
7
|
+
extends: [
|
|
8
|
+
stylistic.configs.customize({
|
|
9
|
+
braceStyle: '1tbs',
|
|
10
|
+
commaDangle: 'never',
|
|
11
|
+
indent: 4,
|
|
12
|
+
semi: true
|
|
13
|
+
})
|
|
14
|
+
],
|
|
15
|
+
rules: {
|
|
16
|
+
'@stylistic/array-bracket-newline': ['error', 'consistent'],
|
|
17
|
+
'@stylistic/array-element-newline': ['error', 'consistent'],
|
|
18
|
+
'@stylistic/brace-style': ['error', '1tbs'],
|
|
19
|
+
'@stylistic/function-call-spacing': ['error', 'never'],
|
|
20
|
+
'@stylistic/indent': [
|
|
21
|
+
'error',
|
|
22
|
+
4,
|
|
23
|
+
{ CallExpression: { arguments: 'off' }, flatTernaryExpressions: false, SwitchCase: 1, VariableDeclarator: 1 }
|
|
24
|
+
],
|
|
25
|
+
'@stylistic/linebreak-style': ['error', 'unix'],
|
|
26
|
+
'@stylistic/max-len': ['error', { code: 160, comments: 160, ignoreRegExpLiterals: true, ignoreTemplateLiterals: true, ignoreUrls: true }],
|
|
27
|
+
'@stylistic/no-extra-semi': 'error',
|
|
28
|
+
'@stylistic/padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }, { allowSingleLineBlocks: false }],
|
|
29
|
+
'@stylistic/padding-line-between-statements': [
|
|
30
|
+
'error',
|
|
31
|
+
{ blankLine: 'always', prev: ['block', 'block-like', 'class', 'directive'], next: '*' },
|
|
32
|
+
{ blankLine: 'always', prev: '*', next: ['block', 'block-like', 'class', 'return'] },
|
|
33
|
+
{ blankLine: 'never', prev: 'case', next: ['case', 'default'] },
|
|
34
|
+
{ blankLine: 'always', prev: 'import', next: '*' },
|
|
35
|
+
{ blankLine: 'any', prev: 'import', next: 'import' }
|
|
36
|
+
],
|
|
37
|
+
'@stylistic/space-before-function-paren': ['error', { anonymous: 'never', asyncArrow: 'always', named: 'never' }],
|
|
38
|
+
'@stylistic/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
39
|
+
'@stylistic/jsx-curly-spacing': ['error', 'never', { allowMultiline: false }],
|
|
40
|
+
'@stylistic/jsx-max-props-per-line': ['error', { maximum: 3 }],
|
|
41
|
+
'@stylistic/jsx-self-closing-comp': 'error'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]);
|
|
45
|
+
//# sourceMappingURL=stylistic.js.map
|
|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
|
+
import typescriptEslint from 'typescript-eslint';
|
|
3
|
+
import { JS_FILES, TS_FILES } from './common.js';
|
|
4
|
+
export const typescriptConfig = defineConfig([
|
|
5
|
+
{
|
|
6
|
+
files: JS_FILES,
|
|
7
|
+
extends: [typescriptEslint.configs.recommended],
|
|
8
|
+
rules: {
|
|
9
|
+
'@typescript-eslint/no-require-imports': 'off'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
files: TS_FILES,
|
|
14
|
+
rules: {
|
|
15
|
+
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
16
|
+
'@typescript-eslint/explicit-member-accessibility': ['warn', { overrides: { constructors: 'no-public' } }],
|
|
17
|
+
'@typescript-eslint/naming-convention': [
|
|
18
|
+
'error',
|
|
19
|
+
{
|
|
20
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
21
|
+
leadingUnderscore: 'allow',
|
|
22
|
+
selector: 'variableLike'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
26
|
+
'@typescript-eslint/no-unused-vars': 'error'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
]);
|
|
30
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,gBAAgB,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;IACzC;QACI,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;QAC/C,KAAK,EAAE;YACH,uCAAuC,EAAE,KAAK;SACjD;KACJ;IACD;QACI,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE;YACH,kDAAkD,EAAE,MAAM;YAC1D,kDAAkD,EAAE,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,CAAC;YAC1G,sCAAsC,EAAE;gBACpC,OAAO;gBACP;oBACI,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;oBACjD,iBAAiB,EAAE,OAAO;oBAC1B,QAAQ,EAAE,cAAc;iBAC3B;aACJ;YACD,oCAAoC,EAAE,MAAM;YAC5C,mCAAmC,EAAE,OAAO;SAC/C;KACJ;CACmB,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
2
|
+
import { commonConfig } from './configs/common.js';
|
|
3
|
+
import { jsonConfig } from './configs/json.js';
|
|
4
|
+
import { nConfig } from './configs/n.js';
|
|
5
|
+
import { reactHooksConfig } from './configs/react-hooks.js';
|
|
6
|
+
import { stylisticConfig } from './configs/stylistic.js';
|
|
7
|
+
import { typescriptConfig } from './configs/typescript.js';
|
|
8
|
+
export function config(params = {}) {
|
|
9
|
+
const { useReact = false } = params;
|
|
10
|
+
return defineConfig([
|
|
11
|
+
globalIgnores(['**/dist'], 'ignore-dist'),
|
|
12
|
+
...commonConfig,
|
|
13
|
+
...typescriptConfig,
|
|
14
|
+
...(useReact ? reactHooksConfig : nConfig),
|
|
15
|
+
...stylisticConfig,
|
|
16
|
+
...jsonConfig
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM3D,MAAM,UAAU,MAAM,CAAC,SAAuB,EAAE;IAC5C,MAAM,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;IAEpC,OAAO,YAAY,CAAC;QAChB,aAAa,CAAC,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC;QAEzC,GAAG,YAAY;QACf,GAAG,gBAAgB;QAEnB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1C,GAAG,eAAe;QAClB,GAAG,UAAU;KAChB,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,27 +3,36 @@
|
|
|
3
3
|
"description": "Common Ringier Axel Springer ESLint configuration",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {},
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
7
9
|
"engines": {
|
|
8
|
-
"node": "^
|
|
10
|
+
"node": "^22||^24||^26"
|
|
9
11
|
},
|
|
10
12
|
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
11
14
|
"lint": "npm run lint:js",
|
|
12
|
-
"lint:js": "eslint
|
|
13
|
-
"lint:js:fix": "npm run lint:js -- --fix"
|
|
15
|
+
"lint:js": "eslint",
|
|
16
|
+
"lint:js:fix": "npm run lint:js -- --fix",
|
|
17
|
+
"prebuild": "rimraf dist",
|
|
18
|
+
"prepare": "npm run build"
|
|
14
19
|
},
|
|
15
20
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"eslint": "^
|
|
19
|
-
"eslint-plugin
|
|
20
|
-
"eslint
|
|
21
|
-
"eslint-plugin-
|
|
22
|
-
"eslint-plugin-react-hooks": "^
|
|
23
|
-
"
|
|
21
|
+
"@eslint/config-helpers": "*",
|
|
22
|
+
"@eslint/js": "^10.0.0",
|
|
23
|
+
"@eslint/json": "^2.0.0",
|
|
24
|
+
"@stylistic/eslint-plugin": "^5.0.0",
|
|
25
|
+
"eslint": "^10.0.0",
|
|
26
|
+
"eslint-plugin-n": "^18.0.0",
|
|
27
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
28
|
+
"globals": "^17.0.0",
|
|
29
|
+
"typescript-eslint": "^8.0.0"
|
|
24
30
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@ringieraxelspringer/tsconfig": "^8.0.0",
|
|
33
|
+
"@types/node": "^26.0.0",
|
|
34
|
+
"rimraf": "^6.0.0",
|
|
35
|
+
"typescript": "^6.0.0"
|
|
27
36
|
},
|
|
28
|
-
"version": "
|
|
37
|
+
"version": "25.0.0-alpha.6"
|
|
29
38
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
# CHANGELOG
|
|
2
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
3
|
-
|
|
4
|
-
## 24.3.0 - 2026-10-15
|
|
5
|
-
### Added
|
|
6
|
-
- [@gwozniak]: Added support for Node v26.
|
|
7
|
-
|
|
8
|
-
## 24.2.0 - 2025-09-26
|
|
9
|
-
### Added
|
|
10
|
-
- [@mdulawa]: Added support for Node v24.
|
|
11
|
-
|
|
12
|
-
## 24.1.2 - 2025-01-03
|
|
13
|
-
### Removed
|
|
14
|
-
- [@mdulawa]: Disabled `react/react-in-jsx-scope` rule of `eslint-plugin-react`.
|
|
15
|
-
|
|
16
|
-
## 24.1.1 - 2024-11-14
|
|
17
|
-
### Added
|
|
18
|
-
- [@gheprovider]: GitHub Actions.
|
|
19
|
-
|
|
20
|
-
## 24.1.0 - 2024-10-31
|
|
21
|
-
### Added
|
|
22
|
-
- [@mdulawa]: Added support for Node v22.
|
|
23
|
-
|
|
24
|
-
## 24.0.2 - 2024-10-17
|
|
25
|
-
### Changed
|
|
26
|
-
- [@gwozniak]: Disabled `n/no-missing-import` rule of `eslint-plugin-n`.
|
|
27
|
-
|
|
28
|
-
## 24.0.1 - 2024-09-20
|
|
29
|
-
### Changed
|
|
30
|
-
- [@pniewiejski]: Disable `n/no-process-exit` rule of `eslint-plugin-n` to be consistent with the existing setting of `no-process-exit`.
|
|
31
|
-
|
|
32
|
-
## 24.0.0 - 2024-09-13
|
|
33
|
-
### Changed
|
|
34
|
-
- [@mdulawa]: Replaced deprecated plugin `eslint-plugin-node` with `eslint-plugin-n`.
|
|
35
|
-
- [@mdulawa]: Replaced deprecated rule `global-require` with `n/global-require`.
|
|
36
|
-
- [@mdulawa]: Replaced deprecated rule `no-buffer-constructor` with `n/prefer-global/buffer`.
|
|
37
|
-
- [@mdulawa]: Replaced deprecated rule `node/no-missing-import` with `n/no-missing-import`.
|
|
38
|
-
- [@mdulawa]: Replaced deprecated rule `newline-before-return` with `padding-line-between-statements`.
|
|
39
|
-
|
|
40
|
-
### Removed
|
|
41
|
-
- [@mdulawa]: Dropped support for Node v16.
|
|
42
|
-
- [@mdulawa]: Dropped support for Node v14.
|
|
43
|
-
|
|
44
|
-
## 23.0.0 - 2023-10-24
|
|
45
|
-
### Added
|
|
46
|
-
- [@mdulawa]: Added support for Node v20.
|
|
47
|
-
|
|
48
|
-
### Removed
|
|
49
|
-
- [@mdulawa]: Dropped support for Node v12.
|
|
50
|
-
|
|
51
|
-
## 22.0.1 - 2023-05-30
|
|
52
|
-
### Fixed
|
|
53
|
-
- [@mdulawa]: Fixed ECMA version after removal of default parser `@babel/eslint-parser`.
|
|
54
|
-
|
|
55
|
-
## 22.0.0 - 2023-05-26
|
|
56
|
-
### Removed
|
|
57
|
-
- [@kpiatek2]: Removed default parser `@babel/eslint-parser`.
|
|
58
|
-
|
|
59
|
-
## 21.0.0 - 2023-04-25
|
|
60
|
-
### Added
|
|
61
|
-
- [@mkuranda]: Added [jsx-tag-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule.
|
|
62
|
-
|
|
63
|
-
## 20.0.1 - 2023-03-27
|
|
64
|
-
### Fixed
|
|
65
|
-
- [@mkasprzyk]: Added `PascalCase` to `naming-convention` rule values.
|
|
66
|
-
|
|
67
|
-
## 20.0.0 - 2023-02-09
|
|
68
|
-
### Added
|
|
69
|
-
- [@mwoloszyn]: Added [camelcase](https://eslint.org/docs/latest/rules/camelcase) rule.
|
|
70
|
-
- [@mwoloszyn]: Added [@typescript-eslint/naming-convention](https://typescript-eslint.io/rules/naming-convention) rule.
|
|
71
|
-
|
|
72
|
-
## 19.0.0 - 2023-01-14
|
|
73
|
-
### Added
|
|
74
|
-
- [@mdulawa]: Added [dot-location](https://eslint.org/docs/latest/rules/dot-location) rule.
|
|
75
|
-
- [@mdulawa]: Added [dot-notation](https://eslint.org/docs/latest/rules/dot-notation) rule.
|
|
76
|
-
|
|
77
|
-
## 18.0.0 - 2022-11-18
|
|
78
|
-
### Added
|
|
79
|
-
- [@mdulawa]: Added [no-implicit-coercion](https://eslint.org/docs/latest/rules/no-implicit-coercion) rule.
|
|
80
|
-
|
|
81
|
-
## 17.1.0 - 2022-10-26
|
|
82
|
-
### Added
|
|
83
|
-
- [@pbizon]: Added support for Node v18.
|
|
84
|
-
|
|
85
|
-
## 17.0.0 - 2022-07-14
|
|
86
|
-
### Added
|
|
87
|
-
- [@mkuranda]: Added [@typescript-eslint/space-infix-ops](https://typescript-eslint.io/rules/space-infix-ops) rule.
|
|
88
|
-
|
|
89
|
-
## 16.0.0 - 2022-06-09
|
|
90
|
-
### Added
|
|
91
|
-
- [@mdulawa]: Added [max-statements-per-line](https://eslint.org/docs/rules/max-statements-per-line) rule.
|
|
92
|
-
|
|
93
|
-
## 15.0.0 - 2022-06-01
|
|
94
|
-
### Added
|
|
95
|
-
- [@mkasprzyk]: Added `max-classes-per-file` rule.
|
|
96
|
-
|
|
97
|
-
## 14.0.0 - 2022-05-20
|
|
98
|
-
### Fixed
|
|
99
|
-
- [@mdulawa]: Rule `padding-line-between-statements`: Don't need blank line before `default` in `switch` construction.
|
|
100
|
-
|
|
101
|
-
## 13.0.0 - 2022-02-22
|
|
102
|
-
### Added
|
|
103
|
-
- [@mdulawa]: Added support for Node v16.
|
|
104
|
-
|
|
105
|
-
### Changed
|
|
106
|
-
- [@mdulawa]: Bumped version of `eslint` and `@typescript-eslint`.
|
|
107
|
-
|
|
108
|
-
## 12.0.0 - 2021-12-06
|
|
109
|
-
### Added
|
|
110
|
-
- [@mdulawa]: Added `semi-spacing` rule.
|
|
111
|
-
|
|
112
|
-
### Removed
|
|
113
|
-
- [@mdulawa]: Dropped support for Node v10.
|
|
114
|
-
|
|
115
|
-
## 11.0.0 - 2021-11-12
|
|
116
|
-
### Added
|
|
117
|
-
- [@pniewiejski]: Added `@typescript-eslint/semi` rule.
|
|
118
|
-
|
|
119
|
-
## 10.0.1 - 2021-09-01
|
|
120
|
-
### Fixed
|
|
121
|
-
- [@tzachara]: Fixed override rule `@typescript-eslint/type-annotation-spacing` for arrow type definitions.
|
|
122
|
-
|
|
123
|
-
## 10.0.0 - 2021-08-24
|
|
124
|
-
### Added
|
|
125
|
-
- [@tzachara]: Added `@typescript-eslint/member-delimiter-style` rule.
|
|
126
|
-
- [@tzachara]: Added `@typescript-eslint/type-annotation-spacing` rule.
|
|
127
|
-
|
|
128
|
-
## 9.0.0 - 2021-06-25
|
|
129
|
-
### Added
|
|
130
|
-
- [@pbizon]: Added `multiline-ternary` rule.
|
|
131
|
-
- [@pbizon]: Added `operator-linebreak` rule.
|
|
132
|
-
|
|
133
|
-
## 8.0.0 - 2021-06-24
|
|
134
|
-
### Added
|
|
135
|
-
- [@mdulawa]: Added `padded-blocks` rule.
|
|
136
|
-
|
|
137
|
-
## 7.0.1 - 2021-06-18
|
|
138
|
-
### Fixed
|
|
139
|
-
- [@jbienkowski2]: Remove `@typescript-eslint/prefer-nullish-coalescing` rule as it requires additional TypeScript parser options which may not work for some projects.
|
|
140
|
-
- [@jbienkowski2]: Remove `@typescript-eslint/prefer-readonly` rule as it requires additional TypeScript parser options which may not work for some projects.
|
|
141
|
-
|
|
142
|
-
## 7.0.0 - 2021-06-16
|
|
143
|
-
### Added
|
|
144
|
-
- [@jbienkowski2]: Added `@typescript-eslint/explicit-function-return-type` rule.
|
|
145
|
-
- [@jbienkowski2]: Added `@typescript-eslint/explicit-member-accessibility` rule.
|
|
146
|
-
- [@jbienkowski2]: Added `@typescript-eslint/prefer-nullish-coalescing` rule.
|
|
147
|
-
- [@jbienkowski2]: Added `@typescript-eslint/prefer-optional-chain` rule.
|
|
148
|
-
- [@jbienkowski2]: Added `@typescript-eslint/prefer-readonly` rule.
|
|
149
|
-
- [@jbienkowski2]: Added `@typescript-eslint/prefer-ts-expect-error` rule.
|
|
150
|
-
|
|
151
|
-
## 6.0.2 - 2021-06-14
|
|
152
|
-
### Fixed
|
|
153
|
-
- [@mwieczorkiewicz]: Added new `padding-line-between-statements` condition for `case` statements in order to avoid conflict with `no-fallthrough` rule.
|
|
154
|
-
|
|
155
|
-
## 6.0.1 - 2021-04-21
|
|
156
|
-
### Changed
|
|
157
|
-
- [@mdulawa]: Switched to `@babel/eslint-parser`.
|
|
158
|
-
|
|
159
|
-
## 6.0.0 - 2021-01-28
|
|
160
|
-
### Added
|
|
161
|
-
- [@mkasprzyk]: Added `key-spacing` rule.
|
|
162
|
-
- [@mkasprzyk]: Added `prefer-template` rule.
|
|
163
|
-
- [@mkasprzyk]: Added `require-atomic-updates` rule.
|
|
164
|
-
|
|
165
|
-
## 5.0.1 - 2021-01-28
|
|
166
|
-
### Fixed
|
|
167
|
-
- [@mdulawa]: Tuned `eslint-plugin-node` rules for TypeScript.
|
|
168
|
-
|
|
169
|
-
## 5.0.0 - 2021-01-25
|
|
170
|
-
### Added
|
|
171
|
-
- [@mdulawa]: Added `eslint-plugin-node` plugin because of deprecation of Node rules in ESLint core.
|
|
172
|
-
|
|
173
|
-
## 4.0.0 - 2020-12-31
|
|
174
|
-
### Added
|
|
175
|
-
- [@jbienkowski2]: Added `prefer-arrow-callback` rule.
|
|
176
|
-
|
|
177
|
-
## 3.3.0 - 2020-12-15
|
|
178
|
-
### Changed
|
|
179
|
-
- [@mdulawa]: Tested on Node v14.
|
|
180
|
-
|
|
181
|
-
## 3.2.0 - 2020-12-10
|
|
182
|
-
### Added
|
|
183
|
-
- [@mkorus]: Added `eslint-plugin-react-hooks`.
|
|
184
|
-
|
|
185
|
-
## 3.1.0 - 2020-12-02
|
|
186
|
-
### Changed
|
|
187
|
-
- [@mdulawa]: Detect React version.
|
|
188
|
-
|
|
189
|
-
## 3.0.0 - 2020-11-27
|
|
190
|
-
### Added
|
|
191
|
-
- [@mkasprzyk]: Added `require-await` and `yoda` rules.
|
|
192
|
-
|
|
193
|
-
### Changed
|
|
194
|
-
- [@mkasprzyk]: Added new padding lines before statements in `padding-line-between-statements` rule.
|
|
195
|
-
|
|
196
|
-
## 2.0.0 - 2020-10-05
|
|
197
|
-
### Changed
|
|
198
|
-
- [@mdulawa]: Renamed to `@ringieraxelspringer/eslint-config`.
|
|
199
|
-
|
|
200
|
-
## 1.9.0 - 2020-09-24
|
|
201
|
-
### Added
|
|
202
|
-
- [@kpiatek2]: Added `space-in-parens` rule.
|
|
203
|
-
- [@kpiatek2]: Bumped version `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser`, `eslint`, `eslint-plugin-react`, `typescript`.
|
|
204
|
-
|
|
205
|
-
## 1.8.0 - 2020-09-10
|
|
206
|
-
### Changed
|
|
207
|
-
- [@mdulawa]: Bumped version of `@typescript-eslint`.
|
|
208
|
-
- [@mdulawa]: Added compare links to changelog.
|
|
209
|
-
|
|
210
|
-
## 1.7.0 - 2020-07-28
|
|
211
|
-
### Changed
|
|
212
|
-
- [@mdulawa]: Bumped version of `eslint` and `@typescript-eslint`.
|
|
213
|
-
|
|
214
|
-
## 1.6.0 - 2020-07-09
|
|
215
|
-
### Added
|
|
216
|
-
- [@kpiatek2]: Added `quote-props`, `linebreak-style` rules.
|
|
217
|
-
- [@kpiatek2]: Added eslint scripts to package.json.
|
|
218
|
-
- [@kpiatek2]: Use eslint by himself.
|
|
219
|
-
|
|
220
|
-
## 1.5.0 - 2020-05-22
|
|
221
|
-
### Added
|
|
222
|
-
- [@pbizon]: Added `quote-props`, `linebreak-style` rules.
|
|
223
|
-
|
|
224
|
-
## 1.4.0 - 2020-04-17
|
|
225
|
-
### Added
|
|
226
|
-
- [@mdulawa]: Enabled `eol-last` rule.
|
|
227
|
-
|
|
228
|
-
### Changed
|
|
229
|
-
- [@mdulawa]: Changed `no-multiple-empty-lines` rule.
|
|
230
|
-
|
|
231
|
-
## 1.3.0 - 2020-03-30
|
|
232
|
-
### Added
|
|
233
|
-
- [@mdulawa]: Enabled `no-buffer-constructor` rule.
|
|
234
|
-
|
|
235
|
-
## 1.2.0 - 2020-03-13
|
|
236
|
-
### Changed
|
|
237
|
-
- [@mdulawa]: Disabled `no-magic-numbers` rule.
|
|
238
|
-
|
|
239
|
-
## 1.1.1 - 2020-02-12
|
|
240
|
-
### Changed
|
|
241
|
-
- [@alacki]: Changed `no-alert`, `no-console` rules.
|
|
242
|
-
|
|
243
|
-
## 1.1.0 - 2020-01-21
|
|
244
|
-
### Changed
|
|
245
|
-
- [@mmitis]: Changed `comma-dangle` rule.
|
|
246
|
-
|
|
247
|
-
## 1.0.1 - 2020-01-08
|
|
248
|
-
### Added
|
|
249
|
-
- [@mdulawa]: Added `reportUnusedDisableDirectives: true` option.
|
|
250
|
-
|
|
251
|
-
## 1.0.0 - 2019-12-13
|
|
252
|
-
### Added
|
|
253
|
-
- [@mdulawa]: Initial version.
|
package/lib/index.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
reportUnusedDisableDirectives: true,
|
|
4
|
-
extends: [
|
|
5
|
-
'eslint:recommended',
|
|
6
|
-
'plugin:n/recommended',
|
|
7
|
-
'plugin:react/recommended',
|
|
8
|
-
'plugin:react-hooks/recommended'
|
|
9
|
-
],
|
|
10
|
-
parserOptions: {
|
|
11
|
-
requireConfigFile: false,
|
|
12
|
-
sourceType: 'module',
|
|
13
|
-
allowImportExportEverywhere: true,
|
|
14
|
-
codeFrame: false,
|
|
15
|
-
ecmaVersion: 2024,
|
|
16
|
-
ecmaFeatures: {
|
|
17
|
-
jsx: true
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
env: {
|
|
21
|
-
browser: true,
|
|
22
|
-
es2024: true,
|
|
23
|
-
node: true
|
|
24
|
-
},
|
|
25
|
-
plugins: [
|
|
26
|
-
'import',
|
|
27
|
-
'n',
|
|
28
|
-
'react',
|
|
29
|
-
'react-hooks'
|
|
30
|
-
],
|
|
31
|
-
rules: {
|
|
32
|
-
'array-bracket-newline': ['error', 'consistent'],
|
|
33
|
-
'array-element-newline': ['error', 'consistent'],
|
|
34
|
-
'arrow-spacing': 'error',
|
|
35
|
-
'brace-style': 'error',
|
|
36
|
-
'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }],
|
|
37
|
-
'comma-dangle': ['error', 'never'],
|
|
38
|
-
'comma-spacing': ['error', { before: false, after: true }],
|
|
39
|
-
'curly': 'error',
|
|
40
|
-
'dot-location': ['error', 'property'],
|
|
41
|
-
'dot-notation': 'error',
|
|
42
|
-
'eol-last': ['error', 'always'],
|
|
43
|
-
'eqeqeq': ['error', 'always'],
|
|
44
|
-
'func-call-spacing': ['error', 'never'],
|
|
45
|
-
'generator-star-spacing': ['error', { before: false, after: true }],
|
|
46
|
-
'indent': ['error', 4, { CallExpression: { arguments: 'off' }, flatTernaryExpressions: false, SwitchCase: 1, VariableDeclarator: 1 }],
|
|
47
|
-
'jsx-quotes': ['error', 'prefer-double'],
|
|
48
|
-
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
49
|
-
'keyword-spacing': ['error', { before: true }],
|
|
50
|
-
'lines-between-class-members': ['error', 'always'],
|
|
51
|
-
'linebreak-style': ['error', 'unix'],
|
|
52
|
-
'max-classes-per-file': ['warn', { ignoreExpressions: true, max: 1 }],
|
|
53
|
-
'max-len': ['error', { code: 160, comments: 160, ignoreRegExpLiterals: true, ignoreTemplateLiterals: true, ignoreUrls: true }],
|
|
54
|
-
'max-statements-per-line': ['error', { max: 1 }],
|
|
55
|
-
'multiline-ternary': ['error', 'always-multiline'],
|
|
56
|
-
'no-alert': 'error',
|
|
57
|
-
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
|
|
58
|
-
'no-duplicate-imports': 'error',
|
|
59
|
-
'no-empty': 'error',
|
|
60
|
-
'no-empty-function': 'error',
|
|
61
|
-
'no-extra-semi': 'error',
|
|
62
|
-
'no-implicit-coercion': ['error', { boolean: true, disallowTemplateShorthand: true, number: true, string: true }],
|
|
63
|
-
'no-lonely-if': 'error',
|
|
64
|
-
'no-loop-func': 'error',
|
|
65
|
-
'no-magic-numbers': 'off',
|
|
66
|
-
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
67
|
-
'no-multi-spaces': 'error',
|
|
68
|
-
'no-process-exit': 'off',
|
|
69
|
-
'no-trailing-spaces': 'error',
|
|
70
|
-
'no-unused-vars': 'error',
|
|
71
|
-
'no-var': 'error',
|
|
72
|
-
'object-curly-spacing': ['error', 'always'],
|
|
73
|
-
'object-shorthand': ['error', 'properties'],
|
|
74
|
-
'operator-linebreak': ['error', 'before'],
|
|
75
|
-
'padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }, { allowSingleLineBlocks: false }],
|
|
76
|
-
'padding-line-between-statements': [
|
|
77
|
-
'error',
|
|
78
|
-
{ blankLine: 'always', prev: ['block', 'block-like', 'class', 'directive'], next: '*' },
|
|
79
|
-
{ blankLine: 'always', prev: '*', next: ['block', 'block-like', 'class', 'return'] },
|
|
80
|
-
{ blankLine: 'never', prev: 'case', next: ['case', 'default'] }
|
|
81
|
-
],
|
|
82
|
-
'prefer-arrow-callback': 'error',
|
|
83
|
-
'prefer-const': 'error',
|
|
84
|
-
'prefer-promise-reject-errors': 'off',
|
|
85
|
-
'prefer-template': 'error',
|
|
86
|
-
'quote-props': ['error', 'consistent-as-needed'],
|
|
87
|
-
'quotes': ['error', 'single'],
|
|
88
|
-
'require-atomic-updates': 'error',
|
|
89
|
-
'require-await': 'error',
|
|
90
|
-
'semi': ['error', 'always'],
|
|
91
|
-
'semi-spacing': ['error', { after: true, before: false }],
|
|
92
|
-
'space-before-blocks': 'error',
|
|
93
|
-
'space-before-function-paren': ['error', { anonymous: 'never', asyncArrow: 'always', named: 'never' }],
|
|
94
|
-
'space-infix-ops': 'error',
|
|
95
|
-
'space-in-parens': ['error', 'never'],
|
|
96
|
-
'yoda': 'error',
|
|
97
|
-
|
|
98
|
-
'import/newline-after-import': ['error', { count: 1 }],
|
|
99
|
-
'import/no-extraneous-dependencies': 'error',
|
|
100
|
-
|
|
101
|
-
'n/global-require': 'error',
|
|
102
|
-
'n/no-missing-import': 'off',
|
|
103
|
-
'n/no-unpublished-import': 'off',
|
|
104
|
-
'n/no-unpublished-require': 'off',
|
|
105
|
-
'n/prefer-global/buffer': 'error',
|
|
106
|
-
'n/no-process-exit': 'off',
|
|
107
|
-
|
|
108
|
-
'react/jsx-boolean-value': ['error', 'always'],
|
|
109
|
-
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
110
|
-
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: false }],
|
|
111
|
-
'react/jsx-max-props-per-line': ['error', { maximum: 3 }],
|
|
112
|
-
'react/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
|
|
113
|
-
'react/react-in-jsx-scope': 'off',
|
|
114
|
-
'react/self-closing-comp': 'error',
|
|
115
|
-
'react/sort-comp': 'error'
|
|
116
|
-
},
|
|
117
|
-
overrides: [
|
|
118
|
-
{
|
|
119
|
-
files: ['*.ts', '*.tsx'],
|
|
120
|
-
parser: '@typescript-eslint/parser',
|
|
121
|
-
extends: [
|
|
122
|
-
'plugin:@typescript-eslint/recommended'
|
|
123
|
-
],
|
|
124
|
-
plugins: [
|
|
125
|
-
'@typescript-eslint'
|
|
126
|
-
],
|
|
127
|
-
rules: {
|
|
128
|
-
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
129
|
-
'@typescript-eslint/explicit-member-accessibility': ['warn', { overrides: { constructors: 'no-public' } }],
|
|
130
|
-
'@typescript-eslint/member-delimiter-style': [
|
|
131
|
-
'error',
|
|
132
|
-
{
|
|
133
|
-
multiline: { delimiter: 'semi', requireLast: true },
|
|
134
|
-
singleline: { delimiter: 'semi', requireLast: true },
|
|
135
|
-
multilineDetection: 'brackets'
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
'@typescript-eslint/naming-convention': ['error', { selector: 'variableLike', format: ['camelCase', 'UPPER_CASE', 'PascalCase'] }],
|
|
139
|
-
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
140
|
-
'@typescript-eslint/prefer-ts-expect-error': 'error',
|
|
141
|
-
'@typescript-eslint/semi': ['error', 'always'],
|
|
142
|
-
'@typescript-eslint/space-infix-ops': ['error', { int32Hint: false }],
|
|
143
|
-
'@typescript-eslint/type-annotation-spacing': ['error', { before: false, after: true, overrides: { arrow: { before: true, after: true } } }],
|
|
144
|
-
'camelcase': 'off',
|
|
145
|
-
'n/no-unsupported-features/es-builtins': 'off',
|
|
146
|
-
'n/no-unsupported-features/es-syntax': 'off',
|
|
147
|
-
'semi': 'off',
|
|
148
|
-
'space-infix-ops': 'off'
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
settings: {
|
|
153
|
-
react: {
|
|
154
|
-
version: 'detect'
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|