@ringieraxelspringer/eslint-config 25.0.0-alpha.5 → 25.0.0-alpha.7

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 CHANGED
@@ -5,31 +5,40 @@ Common Ringier Axel Springer ESLint configuration.
5
5
  ## Installation
6
6
 
7
7
  ```shell
8
- npm install --save-dev @ringieraxelspringer/eslint-config
8
+ npm install --save-dev eslint @ringieraxelspringer/eslint-config
9
9
  ```
10
10
 
11
11
  ## Usage (eslint.config.js)
12
12
 
13
- ### JavaScript/TypeScript
14
-
15
13
  ```js
16
- const rasEslintConfig = require('@ringieraxelspringer/eslint-config');
14
+ import { config } from '@ringieraxelspringer/eslint-config';
17
15
 
18
- module.exports = rasEslintConfig.config();
16
+ export default config();
19
17
  ```
20
18
 
21
19
  ### React
22
20
 
21
+ Adds `eslint-plugin-react-hooks` rules and skips the Node.js-specific `eslint-plugin-n` rules.
22
+
23
23
  ```js
24
- const rasEslintConfig = require('@ringieraxelspringer/eslint-config');
24
+ import { config } from '@ringieraxelspringer/eslint-config';
25
25
 
26
- module.exports = rasEslintConfig.config({ useReact: true });
26
+ export default config({ useReact: true });
27
27
  ```
28
28
 
29
- ### Use Babel parser
29
+ ### Extending
30
30
 
31
- ```js
32
- const rasEslintConfig = require('@ringieraxelspringer/eslint-config');
31
+ `config()` returns a flat config array, so project-specific entries can be appended:
33
32
 
34
- module.exports = rasEslintConfig.config({ jsParser: 'babel' });
33
+ ```js
34
+ import { config } from '@ringieraxelspringer/eslint-config';
35
+
36
+ export default [
37
+ ...config(),
38
+ {
39
+ rules: {
40
+ 'no-console': 'off'
41
+ }
42
+ }
43
+ ];
35
44
  ```
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const FILES_JS = "**/*.{cjs,js,jsx,mjs}";
3
+ export declare const FILES_TS = "**/*.{cts,mts,ts,tsx}";
4
+ export declare const commonConfig: Linter.Config[];
@@ -0,0 +1,52 @@
1
+ import js from '@eslint/js';
2
+ import globals from 'globals';
3
+ export const FILES_JS = '**/*.{cjs,js,jsx,mjs}';
4
+ export const FILES_TS = '**/*.{cts,mts,ts,tsx}';
5
+ export const commonConfig = [
6
+ {
7
+ ...js.configs.recommended,
8
+ files: [FILES_JS, FILES_TS],
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: [FILES_JS, FILES_TS],
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,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AAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACjH,cAAc,EAAE,OAAO;YACvB,cAAc,EAAE,OAAO;YACvB,QAAQ,EAAE,OAAO;YACjB,kBAAkB,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;YAC3C,uBAAuB,EAAE,OAAO;YAChC,cAAc,EAAE,OAAO;YACvB,iBAAiB,EAAE,OAAO;YAC1B,wBAAwB,EAAE,OAAO;YACjC,eAAe,EAAE,OAAO;YACxB,MAAM,EAAE,OAAO;SAClB;KACJ;CACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Linter } from 'eslint';
2
+ export declare const jsonConfig: Linter.Config[];
@@ -0,0 +1,15 @@
1
+ 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 { FILES_JS, FILES_TS } from './common.js';
4
+ export const nConfig = defineConfig([
5
+ {
6
+ extends: [n.configs['flat/recommended']],
7
+ files: [FILES_JS, FILES_TS],
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: [FILES_TS],
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,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QACxC,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC3B,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,CAAC,QAAQ,CAAC;QACjB,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 { FILES_JS } from './common.js';
4
+ export const reactHooksConfig = defineConfig([
5
+ {
6
+ extends: [configs.flat.recommended],
7
+ files: [FILES_JS]
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,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;QACnC,KAAK,EAAE,CAAC,QAAQ,CAAC;KACpB;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 { FILES_JS, FILES_TS } from './common.js';
4
+ export const stylisticConfig = defineConfig([
5
+ {
6
+ extends: [
7
+ stylistic.configs.customize({
8
+ braceStyle: '1tbs',
9
+ commaDangle: 'never',
10
+ indent: 4,
11
+ semi: true
12
+ })
13
+ ],
14
+ files: [FILES_JS, FILES_TS],
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylistic.js","sourceRoot":"","sources":["../../src/configs/stylistic.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,SAAS,MAAM,0BAA0B,CAAC;A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,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE;gBACvF,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE;gBACpF,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;gBAC/D,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE;gBAClD,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;aACvD;YACD,wCAAwC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;YAEjH,yCAAyC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC;YACpE,8BAA8B,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;YAC7E,mCAAmC,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;YAC9D,kCAAkC,EAAE,OAAO;SAC9C;KACJ;CACmB,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const typescriptConfig: import("@eslint/config-helpers").ConfigObject[];
@@ -0,0 +1,24 @@
1
+ import { defineConfig } from '@eslint/config-helpers';
2
+ import typescriptEslint from 'typescript-eslint';
3
+ import { FILES_TS } from './common.js';
4
+ export const typescriptConfig = defineConfig([
5
+ {
6
+ extends: [typescriptEslint.configs.recommended],
7
+ files: [FILES_TS],
8
+ rules: {
9
+ '@typescript-eslint/explicit-function-return-type': 'warn',
10
+ '@typescript-eslint/explicit-member-accessibility': ['warn', { overrides: { constructors: 'no-public' } }],
11
+ '@typescript-eslint/naming-convention': [
12
+ 'error',
13
+ {
14
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
15
+ leadingUnderscore: 'allow',
16
+ selector: 'variableLike'
17
+ }
18
+ ],
19
+ '@typescript-eslint/no-explicit-any': 'warn',
20
+ '@typescript-eslint/no-unused-vars': 'error'
21
+ }
22
+ }
23
+ ]);
24
+ //# 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,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;IACzC;QACI,OAAO,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC;QAC/C,KAAK,EAAE,CAAC,QAAQ,CAAC;QACjB,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"}
@@ -0,0 +1,5 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface ConfigParams {
3
+ useReact?: boolean;
4
+ }
5
+ export declare function config(params?: ConfigParams): Linter.Config[];
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,37 +3,36 @@
3
3
  "description": "Common Ringier Axel Springer ESLint configuration",
4
4
  "license": "MIT",
5
5
  "repository": {},
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "type": "module",
8
+ "types": "dist/index.d.ts",
8
9
  "engines": {
9
- "node": "^18||^20||^22"
10
+ "node": "^22||^24||^26"
10
11
  },
11
12
  "scripts": {
12
13
  "build": "tsc",
13
14
  "lint": "npm run lint:js",
14
- "lint:js": "eslint src/",
15
+ "lint:js": "eslint",
15
16
  "lint:js:fix": "npm run lint:js -- --fix",
16
- "prepare": "npm run build --silent",
17
- "prebuild": "rimraf lib"
17
+ "prebuild": "rimraf dist",
18
+ "prepare": "npm run build"
18
19
  },
19
20
  "dependencies": {
20
- "@babel/core": "^7.26.0",
21
- "@babel/eslint-parser": "^7.25.9",
22
- "@eslint/js": "^9.0.0",
23
- "@ringieraxelspringer/tsconfig": "^6.0.0",
24
- "@stylistic/eslint-plugin-js": "^2.11.0",
25
- "@stylistic/eslint-plugin-jsx": "^3.0.0",
26
- "@stylistic/eslint-plugin-ts": "^3.0.0",
27
- "@types/node": "^22.0.0",
28
- "eslint": "^9.19.0",
29
- "eslint-plugin-import": "^2.0.0",
30
- "eslint-plugin-n": "^17.0.0",
31
- "eslint-plugin-react": "^7.0.0",
32
- "eslint-plugin-react-hooks": "^5.0.0",
33
- "globals": "^16.0.0",
34
- "rimraf": "^6.0.0",
35
- "typescript": "^5.0.0",
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",
36
29
  "typescript-eslint": "^8.0.0"
37
30
  },
38
- "version": "25.0.0-alpha.5"
31
+ "devDependencies": {
32
+ "@ringieraxelspringer/tsconfig": "^8.0.0",
33
+ "@types/node": "^26.0.0",
34
+ "rimraf": "^6.0.0",
35
+ "typescript": "^6.0.0"
36
+ },
37
+ "version": "25.0.0-alpha.7"
39
38
  }
package/CHANGELOG.md DELETED
@@ -1,250 +0,0 @@
1
- # CHANGELOG
2
-
3
- The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
4
-
5
- ## [25.0.0] - 2025-01-28
6
- ### Added
7
- - [@gwozniak]: Eslint V9.
8
-
9
- ## [24.1.2] - 2025-01-03
10
- ### Removed
11
- - [@mdulawa]: Disabled `react/react-in-jsx-scope` rule of `eslint-plugin-react`.
12
-
13
- ## [24.1.1] - 2024-11-14
14
- ### Added
15
- - [@gheprovider]: GitHub Actions.
16
-
17
- ## [24.1.0] - 2024-10-31
18
- ### Added
19
- - [@mdulawa]: Added support for Node v22.
20
-
21
- ## [24.0.2] - 2024-10-17
22
- ### Changed
23
- - [@gwozniak]: Disabled `n/no-missing-import` rule of `eslint-plugin-n`.
24
-
25
- ## [24.0.1] - 2024-09-20
26
- ### Changed
27
- - [@pniewiejski]: Disable `n/no-process-exit` rule of `eslint-plugin-n` to be consisten with the existing setting of `no-process-exit`.
28
-
29
- ## [24.0.0] - 2024-09-13
30
- ### Changed
31
- - [@mdulawa]: Replaced deprecated plugin `eslint-plugin-node` with `eslint-plugin-n`.
32
- - [@mdulawa]: Replaced deprecated rule `global-require` with `n/global-require`.
33
- - [@mdulawa]: Replaced deprecated rule `no-buffer-constructor` with `n/prefer-global/buffer`.
34
- - [@mdulawa]: Replaced deprecated rule `node/no-missing-import` with `n/no-missing-import`.
35
- - [@mdulawa]: Replaced deprecated rule `newline-before-return` with `padding-line-between-statements`.
36
-
37
- ### Removed
38
- - [@mdulawa]: Dropped support for Node v16.
39
- - [@mdulawa]: Dropped support for Node v14.
40
-
41
- ## [23.0.0] - 2023-10-24
42
- ### Added
43
- - [@mdulawa]: Added support for Node v20.
44
-
45
- ### Removed
46
- - [@mdulawa]: Dropped support for Node v12.
47
-
48
- ## [22.0.1] - 2023-05-30
49
- ### Fixed
50
- - [@mdulawa]: Fixed ECMA version after removal of default parser `@babel/eslint-parser`.
51
-
52
- ## [22.0.0] - 2023-05-26
53
- ### Removed
54
- - [@kpiatek2]: Removed default parser `@babel/eslint-parser`.
55
-
56
- ## [21.0.0] - 2023-04-25
57
- ### Added
58
- - [@mkuranda]: Added [jsx-tag-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule.
59
-
60
- ## [20.0.1] - 2023-03-27
61
- ### Fixed
62
- - [@mkasprzyk]: Added `PascalCase` to `naming-convention` rule values.
63
-
64
- ## [20.0.0] - 2023-02-09
65
- ### Added
66
- - [@mwoloszyn]: Added [camelcase](https://eslint.org/docs/latest/rules/camelcase) rule.
67
- - [@mwoloszyn]: Added [@typescript-eslint/naming-convention](https://typescript-eslint.io/rules/naming-convention) rule.
68
-
69
- ## [19.0.0] - 2023-01-14
70
- ### Added
71
- - [@mdulawa]: Added [dot-location](https://eslint.org/docs/latest/rules/dot-location) rule.
72
- - [@mdulawa]: Added [dot-notation](https://eslint.org/docs/latest/rules/dot-notation) rule.
73
-
74
- ## [18.0.0] - 2022-11-18
75
- ### Added
76
- - [@mdulawa]: Added [no-implicit-coercion](https://eslint.org/docs/latest/rules/no-implicit-coercion) rule.
77
-
78
- ## [17.1.0] - 2022-10-26
79
- ### Added
80
- - [@pbizon]: Added support for Node v18.
81
-
82
- ## [17.0.0] - 2022-07-14
83
- ### Added
84
- - [@mkuranda]: Added [@typescript-eslint/space-infix-ops](https://typescript-eslint.io/rules/space-infix-ops) rule.
85
-
86
- ## [16.0.0] - 2022-06-09
87
- ### Added
88
- - [@mdulawa]: Added [max-statements-per-line](https://eslint.org/docs/rules/max-statements-per-line) rule.
89
-
90
- ## [15.0.0] - 2022-06-01
91
- ### Added
92
- - [@mkasprzyk]: Added `max-classes-per-file` rule.
93
-
94
- ## [14.0.0] - 2022-05-20
95
- ### Fixed
96
- - [@mdulawa]: Rule `padding-line-between-statements`: Don't need blank line before `default` in `switch` construction.
97
-
98
- ## [13.0.0] - 2022-02-22
99
- ### Added
100
- - [@mdulawa]: Added support for Node v16.
101
-
102
- ### Changed
103
- - [@mdulawa]: Bumped version of `eslint` and `@typescript-eslint`.
104
-
105
- ## [12.0.0] - 2021-12-06
106
- ### Added
107
- - [@mdulawa]: Added `semi-spacing` rule.
108
-
109
- ### Removed
110
- - [@mdulawa]: Dropped support for Node v10.
111
-
112
- ## [11.0.0] - 2021-11-12
113
- ### Added
114
- - [@pniewiejski]: Added `@typescript-eslint/semi` rule.
115
-
116
- ## [10.0.1] - 2021-09-01
117
- ### Fixed
118
- - [@tzachara]: Fixed override rule `@typescript-eslint/type-annotation-spacing` for arrow type definitions.
119
-
120
- ## [10.0.0] - 2021-08-24
121
- ### Added
122
- - [@tzachara]: Added `@typescript-eslint/member-delimiter-style` rule.
123
- - [@tzachara]: Added `@typescript-eslint/type-annotation-spacing` rule.
124
-
125
- ## [9.0.0] - 2021-06-25
126
- ### Added
127
- - [@pbizon]: Added `multiline-ternary` rule.
128
- - [@pbizon]: Added `operator-linebreak` rule.
129
-
130
- ## [8.0.0] - 2021-06-24
131
- ### Added
132
- - [@mdulawa]: Added `padded-blocks` rule.
133
-
134
- ## [7.0.1] - 2021-06-18
135
- ### Fixed
136
- - [@jbienkowski2]: Remove `@typescript-eslint/prefer-nullish-coalescing` rule as it requires additional TypeScript parser options which may not work for some projects.
137
- - [@jbienkowski2]: Remove `@typescript-eslint/prefer-readonly` rule as it requires additional TypeScript parser options which may not work for some projects.
138
-
139
- ## [7.0.0] - 2021-06-16
140
- ### Added
141
- - [@jbienkowski2]: Added `@typescript-eslint/explicit-function-return-type` rule.
142
- - [@jbienkowski2]: Added `@typescript-eslint/explicit-member-accessibility` rule.
143
- - [@jbienkowski2]: Added `@typescript-eslint/prefer-nullish-coalescing` rule.
144
- - [@jbienkowski2]: Added `@typescript-eslint/prefer-optional-chain` rule.
145
- - [@jbienkowski2]: Added `@typescript-eslint/prefer-readonly` rule.
146
- - [@jbienkowski2]: Added `@typescript-eslint/prefer-ts-expect-error` rule.
147
-
148
- ## [6.0.2] - 2021-06-14
149
- ### Fixed
150
- - [@mwieczorkiewicz]: Added new `padding-line-between-statements` condition for `case` statements in order to avoid conflict with `no-fallthrough` rule.
151
-
152
- ## [6.0.1] - 2021-04-21
153
- ### Changed
154
- - [@mdulawa]: Switched to `@babel/eslint-parser`.
155
-
156
- ## [6.0.0] - 2021-01-28
157
- ### Added
158
- - [@mkasprzyk]: Added `key-spacing` rule.
159
- - [@mkasprzyk]: Added `prefer-template` rule.
160
- - [@mkasprzyk]: Added `require-atomic-updates` rule.
161
-
162
- ## [5.0.1] - 2021-01-28
163
- ### Fixed
164
- - [@mdulawa]: Tuned `eslint-plugin-node` rules for TypeScript.
165
-
166
- ## [5.0.0] - 2021-01-25
167
- ### Added
168
- - [@mdulawa]: Added `eslint-plugin-node` plugin because of deprecation of Node rules in ESLint core.
169
-
170
- ## [4.0.0] - 2020-12-31
171
- ### Added
172
- - [@jbienkowski2]: Added `prefer-arrow-callback` rule.
173
-
174
- ## [3.3.0] - 2020-12-15
175
- ### Changed
176
- - [@mdulawa]: Tested on Node v14.
177
-
178
- ## [3.2.0] - 2020-12-10
179
- ### Added
180
- - [@mkorus]: Added `eslint-plugin-react-hooks`.
181
-
182
- ## [3.1.0] - 2020-12-02
183
- ### Changed
184
- - [@mdulawa]: Detect React version.
185
-
186
- ## [3.0.0] - 2020-11-27
187
- ### Added
188
- - [@mkasprzyk]: Added `require-await` and `yoda` rules.
189
-
190
- ### Changed
191
- - [@mkasprzyk]: Added new padding lines before statements in `padding-line-between-statements` rule.
192
-
193
- ## [2.0.0] - 2020-10-05
194
- ### Changed
195
- - [@mdulawa]: Renamed to `@ringieraxelspringer/eslint-config`.
196
-
197
- ## [1.9.0] - 2020-09-24
198
- ### Added
199
- - [@kpiatek2]: Added `space-in-parens` rule.
200
- - [@kpiatek2]: Bumped version `@typescript-eslint/eslint-plugin`, `@typescript-eslint/parser`, `eslint`, `eslint-plugin-react`, `typescript`.
201
-
202
- ## [1.8.0] - 2020-09-10
203
- ### Changed
204
- - [@mdulawa]: Bumped version of `@typescript-eslint`.
205
- - [@mdulawa]: Added compare links to changelog.
206
-
207
- ## [1.7.0] - 2020-07-28
208
- ### Changed
209
- - [@mdulawa]: Bumped version of `eslint` and `@typescript-eslint`.
210
-
211
- ## [1.6.0] - 2020-07-09
212
- ### Added
213
- - [@kpiatek2]: Added `quote-props`, `linebreak-style` rules.
214
- - [@kpiatek2]: Added eslint scripts to package.json.
215
- - [@kpiatek2]: Use eslint by himself.
216
-
217
- ## [1.5.0] - 2020-05-22
218
- ### Added
219
- - [@pbizon]: Added `quote-props`, `linebreak-style` rules.
220
-
221
- ## [1.4.0] - 2020-04-17
222
- ### Added
223
- - [@mdulawa]: Enabled `eol-last` rule.
224
-
225
- ### Changed
226
- - [@mdulawa]: Changed `no-multiple-empty-lines` rule.
227
-
228
- ## [1.3.0] - 2020-03-30
229
- ### Added
230
- - [@mdulawa]: Enabled `no-buffer-constructor` rule.
231
-
232
- ## [1.2.0] - 2020-03-13
233
- ### Changed
234
- - [@mdulawa]: Disabled `no-magic-numbers` rule.
235
-
236
- ## [1.1.1] - 2020-02-12
237
- ### Changed
238
- - [@alacki]: Changed `no-alert`, `no-console` rules.
239
-
240
- ## [1.1.0] - 2020-01-21
241
- ### Changed
242
- - [@mmitis]: Changed `comma-dangle` rule.
243
-
244
- ## [1.0.1] - 2020-01-08
245
- ### Added
246
- - [@mdulawa]: Added `reportUnusedDisableDirectives: true` option.
247
-
248
- ## [1.0.0] - 2019-12-13
249
- ### Added
250
- - [@mdulawa]: Initial version.
package/eslint.config.js DELETED
@@ -1,3 +0,0 @@
1
- const rasEslintConfig = require('./lib');
2
-
3
- module.exports = rasEslintConfig.config();
package/lib/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- declare enum ConfigParamsJsParser {
3
- DEFAULT = "default",
4
- BABEL = "babel"
5
- }
6
- interface ConfigParams {
7
- jsParser?: ConfigParamsJsParser;
8
- useReact?: boolean;
9
- }
10
- export declare function config(params?: ConfigParams): Linter.Config[];
11
- export {};
package/lib/index.js DELETED
@@ -1,256 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.config = config;
40
- const js_1 = __importDefault(require("@eslint/js"));
41
- const eslint_plugin_n_1 = __importDefault(require("eslint-plugin-n"));
42
- const eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
43
- const eslint_parser_1 = __importDefault(require("@babel/eslint-parser"));
44
- const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
45
- const eslintPluginImport = __importStar(require("eslint-plugin-import"));
46
- const eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
47
- const eslint_plugin_js_1 = __importDefault(require("@stylistic/eslint-plugin-js"));
48
- const eslint_plugin_ts_1 = __importDefault(require("@stylistic/eslint-plugin-ts"));
49
- const eslint_plugin_jsx_1 = __importDefault(require("@stylistic/eslint-plugin-jsx"));
50
- const globals_1 = __importDefault(require("globals"));
51
- var ConfigParamsJsParser;
52
- (function (ConfigParamsJsParser) {
53
- ConfigParamsJsParser["DEFAULT"] = "default";
54
- ConfigParamsJsParser["BABEL"] = "babel";
55
- })(ConfigParamsJsParser || (ConfigParamsJsParser = {}));
56
- function config(params = {}) {
57
- var _a;
58
- const configRules = [
59
- js_1.default.configs.recommended,
60
- ...typescript_eslint_1.default.configs.recommended,
61
- {
62
- files: ['**/*.{cjs,js,jsx,mjs}'],
63
- plugins: {
64
- '@stylistic/js': eslint_plugin_js_1.default
65
- },
66
- rules: {
67
- '@stylistic/js/semi': ['error', 'always'],
68
- '@stylistic/js/space-infix-ops': 'error',
69
- 'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }]
70
- }
71
- },
72
- {
73
- files: ['**/*.{cjs,js,jsx,mjs,ts,tsx}'],
74
- plugins: {
75
- 'import': eslintPluginImport,
76
- '@stylistic/js': eslint_plugin_js_1.default
77
- },
78
- languageOptions: {
79
- ecmaVersion: 2025,
80
- sourceType: 'module',
81
- globals: {
82
- ...globals_1.default.browser,
83
- ...globals_1.default.jest,
84
- ...globals_1.default.node,
85
- ...globals_1.default.es2025
86
- }
87
- },
88
- rules: {
89
- '@stylistic/js/array-bracket-newline': ['error', 'consistent'],
90
- '@stylistic/js/array-element-newline': ['error', 'consistent'],
91
- '@stylistic/js/arrow-spacing': 'error',
92
- '@stylistic/js/brace-style': 'error',
93
- '@stylistic/js/comma-dangle': ['error', 'never'],
94
- '@stylistic/js/comma-spacing': ['error', { before: false, after: true }],
95
- '@stylistic/js/dot-location': ['error', 'property'],
96
- '@stylistic/js/eol-last': ['error', 'always'],
97
- '@stylistic/js/func-call-spacing': ['error', 'never'],
98
- '@stylistic/js/generator-star-spacing': ['error', { before: false, after: true }],
99
- '@stylistic/js/indent': [
100
- 'error',
101
- 4,
102
- { CallExpression: { arguments: 'off' }, flatTernaryExpressions: false, SwitchCase: 1, VariableDeclarator: 1 }
103
- ],
104
- '@stylistic/js/jsx-quotes': ['error', 'prefer-double'],
105
- '@stylistic/js/key-spacing': ['error', { beforeColon: false, afterColon: true }],
106
- '@stylistic/js/keyword-spacing': ['error', { before: true }],
107
- '@stylistic/js/lines-between-class-members': ['error', 'always'],
108
- '@stylistic/js/linebreak-style': ['error', 'unix'],
109
- '@stylistic/js/max-len': ['error', { code: 160, comments: 160, ignoreRegExpLiterals: true, ignoreTemplateLiterals: true, ignoreUrls: true }],
110
- '@stylistic/js/max-statements-per-line': ['error', { max: 1 }],
111
- '@stylistic/js/multiline-ternary': ['error', 'always-multiline'],
112
- '@stylistic/js/no-extra-semi': 'error',
113
- '@stylistic/js/no-multi-spaces': 'error',
114
- '@stylistic/js/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
115
- '@stylistic/js/no-trailing-spaces': 'error',
116
- '@stylistic/js/object-curly-spacing': ['error', 'always'],
117
- '@stylistic/js/operator-linebreak': ['error', 'before'],
118
- '@stylistic/js/padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }, { allowSingleLineBlocks: false }],
119
- '@stylistic/js/padding-line-between-statements': [
120
- 'error',
121
- { blankLine: 'always', prev: ['block', 'block-like', 'class', 'directive'], next: '*' },
122
- { blankLine: 'always', prev: '*', next: ['block', 'block-like', 'class', 'return'] },
123
- { blankLine: 'never', prev: 'case', next: ['case', 'default'] }
124
- ],
125
- '@stylistic/js/quote-props': ['error', 'consistent-as-needed'],
126
- '@stylistic/js/quotes': ['error', 'single'],
127
- '@stylistic/js/semi-spacing': ['error', { after: true, before: false }],
128
- '@stylistic/js/space-before-blocks': 'error',
129
- '@stylistic/js/space-before-function-paren': ['error', { anonymous: 'never', asyncArrow: 'always', named: 'never' }],
130
- '@stylistic/js/space-in-parens': ['error', 'never'],
131
- 'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }],
132
- 'curly': 'error',
133
- 'dot-notation': 'error',
134
- 'eqeqeq': ['error', 'always'],
135
- 'max-classes-per-file': ['warn', { ignoreExpressions: true, max: 1 }],
136
- 'no-alert': 'error',
137
- 'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
138
- 'no-duplicate-imports': 'error',
139
- 'no-empty': 'error',
140
- 'no-empty-function': 'error',
141
- 'no-implicit-coercion': ['error', { boolean: true, disallowTemplateShorthand: true, number: true, string: true }],
142
- 'no-lonely-if': 'error',
143
- 'no-loop-func': 'error',
144
- 'no-magic-numbers': 'off',
145
- 'no-unused-vars': 'error',
146
- 'no-var': 'error',
147
- 'object-shorthand': ['error', 'properties'],
148
- 'prefer-arrow-callback': 'error',
149
- 'prefer-const': 'error',
150
- 'prefer-promise-reject-errors': 'off',
151
- 'prefer-template': 'error',
152
- 'require-atomic-updates': 'error',
153
- 'require-await': 'error',
154
- 'yoda': 'error',
155
- 'import/newline-after-import': ['error', { count: 1 }],
156
- 'import/no-extraneous-dependencies': 'error'
157
- }
158
- },
159
- {
160
- files: ['**/*.{ts,tsx}'],
161
- plugins: {
162
- '@stylistic/ts': eslint_plugin_ts_1.default
163
- },
164
- rules: {
165
- "no-unused-vars": "off",
166
- '@stylistic/ts/member-delimiter-style': [
167
- 'error',
168
- {
169
- multiline: { delimiter: 'semi', requireLast: true },
170
- singleline: { delimiter: 'semi', requireLast: true },
171
- multilineDetection: 'brackets'
172
- }
173
- ],
174
- '@stylistic/ts/semi': ['error', 'always'],
175
- '@stylistic/ts/space-infix-ops': ['error', { int32Hint: false }],
176
- '@stylistic/ts/type-annotation-spacing': ['error', { before: false, after: true, overrides: { arrow: { before: true, after: true } } }],
177
- '@typescript-eslint/explicit-function-return-type': 'warn',
178
- '@typescript-eslint/explicit-member-accessibility': ['warn', { overrides: { constructors: 'no-public' } }],
179
- '@typescript-eslint/naming-convention': [
180
- 'error',
181
- {
182
- format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
183
- leadingUnderscore: 'allow',
184
- selector: 'variableLike'
185
- }
186
- ],
187
- '@typescript-eslint/no-explicit-any': 'warn',
188
- "@typescript-eslint/no-unused-vars": "error",
189
- '@typescript-eslint/prefer-ts-expect-error': 'error',
190
- 'n/no-unsupported-features/es-builtins': 'off',
191
- 'n/no-unsupported-features/es-syntax': 'off'
192
- }
193
- }
194
- ];
195
- if (params.useReact) {
196
- configRules.push({
197
- files: ['**/*.{js,jsx,ts,tsx}'],
198
- ...(_a = eslint_plugin_react_1.default.configs.flat) === null || _a === void 0 ? void 0 : _a.recommended,
199
- settings: {
200
- react: {
201
- version: 'detect'
202
- }
203
- },
204
- rules: {
205
- 'react/jsx-boolean-value': ['error', 'always'],
206
- 'react/react-in-jsx-scope': 'off',
207
- 'react/sort-comp': 'error'
208
- }
209
- });
210
- configRules.push({
211
- files: ['**/*.{js,jsx,ts,tsx}'],
212
- plugins: {
213
- 'react-hooks': eslint_plugin_react_hooks_1.default,
214
- '@stylistic/jsx': eslint_plugin_jsx_1.default
215
- },
216
- rules: {
217
- 'react-hooks/rules-of-hooks': 'error',
218
- 'react-hooks/exhaustive-deps': 'warn',
219
- '@stylistic/jsx/jsx-closing-bracket-location': ['error', 'line-aligned'],
220
- '@stylistic/jsx/jsx-curly-spacing': ['error', 'never', { allowMultiline: false }],
221
- '@stylistic/jsx/jsx-max-props-per-line': ['error', { maximum: 3 }],
222
- '@stylistic/jsx/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
223
- '@stylistic/jsx/self-closing-comp': 'error'
224
- }
225
- });
226
- }
227
- else {
228
- configRules.push(eslint_plugin_n_1.default.configs['flat/recommended'], {
229
- files: ['**/*.{js,jsx,ts,tsx}'],
230
- rules: {
231
- 'n/global-require': 'error',
232
- 'n/no-missing-import': 'off',
233
- 'n/no-unpublished-import': 'off',
234
- 'n/no-unpublished-require': 'off',
235
- 'n/prefer-global/buffer': 'error',
236
- 'n/no-process-exit': 'off'
237
- }
238
- }, {
239
- files: ['**/*.{ts,tsx}'],
240
- rules: {
241
- 'n/no-unsupported-features/es-builtins': 'off',
242
- 'n/no-unsupported-features/es-syntax': 'off'
243
- }
244
- });
245
- }
246
- if (params.jsParser === ConfigParamsJsParser.BABEL) {
247
- configRules.push({
248
- files: ['**/*.{js,jsx,ts,tsx}'],
249
- languageOptions: {
250
- parser: eslint_parser_1.default
251
- }
252
- });
253
- }
254
- return configRules;
255
- }
256
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,wBA0NC;AAlPD,oDAAkC;AAElC,sEAA4C;AAC5C,8EAAoD;AACpD,yEAA+C;AAC/C,0EAAiD;AACjD,yEAA2D;AAC3D,0FAA+D;AAE/D,mFAAsD;AACtD,mFAAsD;AACtD,qFAAwD;AACxD,sDAA8B;AAE9B,IAAK,oBAGJ;AAHD,WAAK,oBAAoB;IACrB,2CAAmB,CAAA;IACnB,uCAAe,CAAA;AACnB,CAAC,EAHI,oBAAoB,KAApB,oBAAoB,QAGxB;AAOD,SAAgB,MAAM,CAAC,SAAuB,EAAE;;IAC5C,MAAM,WAAW,GAAoB;QACjC,YAAQ,CAAC,OAAO,CAAC,WAA4B;QAC7C,GAAG,2BAAgB,CAAC,OAAO,CAAC,WAA8B;QAC1D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O,WAAW,CAAC;AACvB,CAAC"}
@@ -1,2 +0,0 @@
1
- declare module 'eslint-plugin-import';
2
- declare module 'eslint-plugin-react-hooks';
package/src/index.ts DELETED
@@ -1,243 +0,0 @@
1
- import eslintJs from '@eslint/js';
2
- import type { Linter } from 'eslint';
3
- import eslintPluginN from 'eslint-plugin-n';
4
- import eslintPluginReact from 'eslint-plugin-react';
5
- import babelParser from '@babel/eslint-parser';
6
- import typescriptEslint from 'typescript-eslint';
7
- import * as eslintPluginImport from 'eslint-plugin-import';
8
- import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
9
-
10
- import stylisticJs from '@stylistic/eslint-plugin-js';
11
- import stylisticTs from '@stylistic/eslint-plugin-ts';
12
- import stylisticJsx from '@stylistic/eslint-plugin-jsx';
13
- import globals from 'globals';
14
-
15
- enum ConfigParamsJsParser {
16
- DEFAULT = 'default',
17
- BABEL = 'babel'
18
- }
19
-
20
- interface ConfigParams {
21
- jsParser?: ConfigParamsJsParser;
22
- useReact?: boolean;
23
- }
24
-
25
- export function config(params: ConfigParams = {}): Linter.Config[] {
26
- const configRules: Linter.Config[] = [
27
- eslintJs.configs.recommended as Linter.Config,
28
- ...typescriptEslint.configs.recommended as Linter.Config[],
29
- {
30
- files: ['**/*.{cjs,js,jsx,mjs}'],
31
- plugins: {
32
- '@stylistic/js': stylisticJs
33
- },
34
- rules: {
35
- '@stylistic/js/semi': ['error', 'always'],
36
- '@stylistic/js/space-infix-ops': 'error',
37
-
38
- 'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }]
39
- }
40
- } as Linter.Config,
41
- {
42
- files: ['**/*.{cjs,js,jsx,mjs,ts,tsx}'],
43
- plugins: {
44
- 'import': eslintPluginImport,
45
- '@stylistic/js': stylisticJs
46
- },
47
- languageOptions: {
48
- ecmaVersion: 2025,
49
- sourceType: 'module',
50
- globals: {
51
- ...globals.browser,
52
- ...globals.jest,
53
- ...globals.node,
54
- ...globals.es2025
55
- }
56
- },
57
- rules: {
58
- '@stylistic/js/array-bracket-newline': ['error', 'consistent'],
59
- '@stylistic/js/array-element-newline': ['error', 'consistent'],
60
- '@stylistic/js/arrow-spacing': 'error',
61
- '@stylistic/js/brace-style': 'error',
62
- '@stylistic/js/comma-dangle': ['error', 'never'],
63
- '@stylistic/js/comma-spacing': ['error', { before: false, after: true }],
64
- '@stylistic/js/dot-location': ['error', 'property'],
65
- '@stylistic/js/eol-last': ['error', 'always'],
66
- '@stylistic/js/func-call-spacing': ['error', 'never'],
67
- '@stylistic/js/generator-star-spacing': ['error', { before: false, after: true }],
68
- '@stylistic/js/indent': [
69
- 'error',
70
- 4,
71
- { CallExpression: { arguments: 'off' }, flatTernaryExpressions: false, SwitchCase: 1, VariableDeclarator: 1 }
72
- ],
73
- '@stylistic/js/jsx-quotes': ['error', 'prefer-double'],
74
- '@stylistic/js/key-spacing': ['error', { beforeColon: false, afterColon: true }],
75
- '@stylistic/js/keyword-spacing': ['error', { before: true }],
76
- '@stylistic/js/lines-between-class-members': ['error', 'always'],
77
- '@stylistic/js/linebreak-style': ['error', 'unix'],
78
- '@stylistic/js/max-len': ['error', { code: 160, comments: 160, ignoreRegExpLiterals: true, ignoreTemplateLiterals: true, ignoreUrls: true }],
79
- '@stylistic/js/max-statements-per-line': ['error', { max: 1 }],
80
- '@stylistic/js/multiline-ternary': ['error', 'always-multiline'],
81
- '@stylistic/js/no-extra-semi': 'error',
82
- '@stylistic/js/no-multi-spaces': 'error',
83
- '@stylistic/js/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
84
- '@stylistic/js/no-trailing-spaces': 'error',
85
- '@stylistic/js/object-curly-spacing': ['error', 'always'],
86
- '@stylistic/js/operator-linebreak': ['error', 'before'],
87
- '@stylistic/js/padded-blocks': ['error', { blocks: 'never', classes: 'never', switches: 'never' }, { allowSingleLineBlocks: false }],
88
- '@stylistic/js/padding-line-between-statements': [
89
- 'error',
90
- { blankLine: 'always', prev: ['block', 'block-like', 'class', 'directive'], next: '*' },
91
- { blankLine: 'always', prev: '*', next: ['block', 'block-like', 'class', 'return'] },
92
- { blankLine: 'never', prev: 'case', next: ['case', 'default'] }
93
- ],
94
- '@stylistic/js/quote-props': ['error', 'consistent-as-needed'],
95
- '@stylistic/js/quotes': ['error', 'single'],
96
- '@stylistic/js/semi-spacing': ['error', { after: true, before: false }],
97
- '@stylistic/js/space-before-blocks': 'error',
98
- '@stylistic/js/space-before-function-paren': ['error', { anonymous: 'never', asyncArrow: 'always', named: 'never' }],
99
- '@stylistic/js/space-in-parens': ['error', 'never'],
100
-
101
- 'camelcase': ['error', { ignoreDestructuring: true, properties: 'never' }],
102
- 'curly': 'error',
103
- 'dot-notation': 'error',
104
- 'eqeqeq': ['error', 'always'],
105
- 'max-classes-per-file': ['warn', { ignoreExpressions: true, max: 1 }],
106
- 'no-alert': 'error',
107
- 'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
108
- 'no-duplicate-imports': 'error',
109
- 'no-empty': 'error',
110
- 'no-empty-function': 'error',
111
- 'no-implicit-coercion': ['error', { boolean: true, disallowTemplateShorthand: true, number: true, string: true }],
112
- 'no-lonely-if': 'error',
113
- 'no-loop-func': 'error',
114
- 'no-magic-numbers': 'off',
115
- 'no-unused-vars': 'error',
116
- 'no-var': 'error',
117
- 'object-shorthand': ['error', 'properties'],
118
- 'prefer-arrow-callback': 'error',
119
- 'prefer-const': 'error',
120
- 'prefer-promise-reject-errors': 'off',
121
- 'prefer-template': 'error',
122
- 'require-atomic-updates': 'error',
123
- 'require-await': 'error',
124
- 'yoda': 'error',
125
-
126
- 'import/newline-after-import': ['error', { count: 1 }],
127
- 'import/no-extraneous-dependencies': 'error'
128
- }
129
- } as Linter.Config,
130
- {
131
- files: ['**/*.{ts,tsx}'],
132
- plugins: {
133
- '@stylistic/ts': stylisticTs
134
- },
135
- rules: {
136
- "no-unused-vars": "off",
137
-
138
- '@stylistic/ts/member-delimiter-style': [
139
- 'error',
140
- {
141
- multiline: { delimiter: 'semi', requireLast: true },
142
- singleline: { delimiter: 'semi', requireLast: true },
143
- multilineDetection: 'brackets'
144
- }
145
- ],
146
- '@stylistic/ts/semi': ['error', 'always'],
147
- '@stylistic/ts/space-infix-ops': ['error', { int32Hint: false }],
148
- '@stylistic/ts/type-annotation-spacing': ['error', { before: false, after: true, overrides: { arrow: { before: true, after: true } } }],
149
-
150
- '@typescript-eslint/explicit-function-return-type': 'warn',
151
- '@typescript-eslint/explicit-member-accessibility': ['warn', { overrides: { constructors: 'no-public' } }],
152
- '@typescript-eslint/naming-convention': [
153
- 'error',
154
- {
155
- format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
156
- leadingUnderscore: 'allow',
157
- selector: 'variableLike'
158
- }
159
- ],
160
- '@typescript-eslint/no-explicit-any': 'warn',
161
- "@typescript-eslint/no-unused-vars": "error",
162
- '@typescript-eslint/prefer-ts-expect-error': 'error',
163
-
164
- 'n/no-unsupported-features/es-builtins': 'off',
165
- 'n/no-unsupported-features/es-syntax': 'off'
166
- }
167
- } as Linter.Config
168
- ];
169
-
170
- if (params.useReact) {
171
- configRules.push(
172
- {
173
- files: ['**/*.{js,jsx,ts,tsx}'],
174
- ...eslintPluginReact.configs.flat?.recommended,
175
- settings: {
176
- react: {
177
- version: 'detect'
178
- }
179
- },
180
- rules: {
181
- 'react/jsx-boolean-value': ['error', 'always'],
182
- 'react/react-in-jsx-scope': 'off',
183
- 'react/sort-comp': 'error'
184
- }
185
- } as Linter.Config
186
- );
187
-
188
- configRules.push(
189
- {
190
- files: ['**/*.{js,jsx,ts,tsx}'],
191
- plugins: {
192
- 'react-hooks': eslintPluginReactHooks,
193
- '@stylistic/jsx': stylisticJsx
194
- },
195
- rules: {
196
- 'react-hooks/rules-of-hooks': 'error',
197
- 'react-hooks/exhaustive-deps': 'warn',
198
-
199
- '@stylistic/jsx/jsx-closing-bracket-location': ['error', 'line-aligned'],
200
- '@stylistic/jsx/jsx-curly-spacing': ['error', 'never', { allowMultiline: false }],
201
- '@stylistic/jsx/jsx-max-props-per-line': ['error', { maximum: 3 }],
202
- '@stylistic/jsx/jsx-tag-spacing': ['error', { beforeSelfClosing: 'always' }],
203
- '@stylistic/jsx/self-closing-comp': 'error'
204
- }
205
- } as Linter.Config
206
- );
207
- } else {
208
- configRules.push(
209
- eslintPluginN.configs['flat/recommended'] as Linter.Config,
210
- {
211
- files: ['**/*.{js,jsx,ts,tsx}'],
212
- rules: {
213
- 'n/global-require': 'error',
214
- 'n/no-missing-import': 'off',
215
- 'n/no-unpublished-import': 'off',
216
- 'n/no-unpublished-require': 'off',
217
- 'n/prefer-global/buffer': 'error',
218
- 'n/no-process-exit': 'off'
219
- }
220
- } as Linter.Config,
221
- {
222
- files: ['**/*.{ts,tsx}'],
223
- rules: {
224
- 'n/no-unsupported-features/es-builtins': 'off',
225
- 'n/no-unsupported-features/es-syntax': 'off'
226
- }
227
- } as Linter.Config
228
- );
229
- }
230
-
231
- if (params.jsParser === ConfigParamsJsParser.BABEL) {
232
- configRules.push(
233
- {
234
- files: ['**/*.{js,jsx,ts,tsx}'],
235
- languageOptions: {
236
- parser: babelParser
237
- }
238
- } as Linter.Config
239
- );
240
- }
241
-
242
- return configRules;
243
- }
package/tsconfig.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@ringieraxelspringer/tsconfig"
3
- }