@st1ggy/linter-config 1.0.79 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.79",
3
+ "version": "2.0.0",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "repository": {
@@ -19,43 +19,46 @@
19
19
  "url": "https://github.com/St1ggy/linter-config/issues"
20
20
  },
21
21
  "homepage": "https://github.com/St1ggy/linter-config#readme",
22
- "peerDependencies": {
23
- "@eslint/js": "^8.57.0",
24
- "angular-eslint": "^18.4.0",
25
- "eslint": "^8.57.0",
26
- "eslint-config-next": "^14.1.4",
27
- "eslint-config-prettier": "^9.1.0",
28
- "eslint-import-resolver-typescript": "^3.6.1",
29
- "eslint-plugin-import": "^2.29.1",
30
- "eslint-plugin-prettier": "^5.1.3",
31
- "eslint-plugin-react": "^7.34.1",
32
- "eslint-plugin-react-hooks": "^4.6.0",
33
- "eslint-plugin-sonarjs": "^1.0.3",
34
- "eslint-plugin-unicorn": "^51.0.1",
35
- "gently-copy": "^3.2.0",
36
- "prettier": "^3.2.5",
37
- "stylelint": "^16.2.1",
38
- "stylelint-config-recommended": "^14.0.0",
39
- "stylelint-config-sass-guidelines": "^11.1.0",
40
- "stylelint-config-tailwindcss": "^0.0.7",
41
- "typescript": "^5.4.3",
42
- "typescript-eslint": "^8.0.0"
22
+ "dependencies": {
23
+ "@eslint/js": "^9.22.0",
24
+ "@stylistic/eslint-plugin-js": "^4.2.0",
25
+ "@stylistic/eslint-plugin-jsx": "^4.2.0",
26
+ "@stylistic/eslint-plugin-migrate": "^4.2.0",
27
+ "@stylistic/eslint-plugin-ts": "^4.2.0",
28
+ "eslint": "^9.22.0",
29
+ "eslint-config-next": "^15.2.2",
30
+ "eslint-config-prettier": "^10.1.1",
31
+ "eslint-import-resolver-typescript": "^3.8.5",
32
+ "eslint-plugin-import": "^2.31.0",
33
+ "eslint-plugin-prettier": "^5.2.3",
34
+ "eslint-plugin-react": "^7.37.4",
35
+ "eslint-plugin-react-hooks": "^5.2.0",
36
+ "eslint-plugin-sonarjs": "^3.0.2",
37
+ "eslint-plugin-unicorn": "^57.0.0",
38
+ "prettier": "^3.5.3",
39
+ "stylelint": "^16.15.0",
40
+ "stylelint-config-recommended": "^15.0.0",
41
+ "stylelint-config-sass-guidelines": "^12.1.0",
42
+ "stylelint-config-tailwindcss": "^1.0.0",
43
+ "typescript": "^5.8.2",
44
+ "typescript-eslint": "^8.26.1"
43
45
  },
44
46
  "type": "module",
45
47
  "exports": {
46
48
  ".": "./src/index.js",
47
- "./eslint-angular": "./src/eslint/eslint.config.angular.js",
48
49
  "./eslint-next": "./src/eslint/eslint.config.next.js",
49
50
  "./eslint-react": "./src/eslint/eslint.config.react.js",
50
51
  "./eslint-typescript": "./src/eslint/eslint.config.typescript.js",
51
52
  "./eslint-common": "./src/eslint/eslint.config.common.js",
52
- "./eslint-svelte": "./src/eslint/eslint.config.svelte.js",
53
53
  "./prettier-common": "./src/prettier/prettier.config.common.js",
54
54
  "./stylelint-common": "./src/stylelint/stylelint.config.common.js",
55
55
  "./stylelint-scss": "./src/stylelint/stylelint.config.scss.js"
56
56
  },
57
- "dependencies": {
58
- "eslint-plugin-svelte": "^2.46.0",
59
- "svelte-eslint-parser": "^0.43.0"
57
+ "files": [
58
+ "src"
59
+ ],
60
+ "scripts": {
61
+ "lint": "eslint .",
62
+ "lint:fix": "eslint . --fix"
60
63
  }
61
64
  }
@@ -1,87 +1,107 @@
1
1
  import eslint from '@eslint/js'
2
- import tseslint from 'typescript-eslint'
2
+ import stylisticJs from '@stylistic/eslint-plugin-js'
3
+ import { config } from 'typescript-eslint'
3
4
 
4
- export default tseslint.config({
5
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
6
- extends: [eslint.configs.recommended],
7
- rules: {
8
- 'no-console': 'warn',
9
- 'no-debugger': 'warn',
10
- 'object-curly-newline': 'off',
11
- 'operator-linebreak': 'off',
12
- 'function-paren-newline': 'off',
13
- 'no-confusing-arrow': 'off',
14
- 'newline-per-chained-call': 'off',
15
- indent: 'off',
16
- 'implicit-arrow-linebreak': 'off',
17
- 'no-undef': 'off',
18
- 'lines-between-class-members': [
19
- 'error',
20
- 'always',
21
- {
22
- exceptAfterSingleLine: true,
23
- },
24
- ],
25
- 'prefer-template': 'error',
26
- 'arrow-body-style': ['error', 'as-needed'],
27
- 'no-return-assign': 'off',
28
- 'newline-before-return': ['error'],
29
- radix: 'off',
30
- 'no-mixed-operators': 'off',
31
- 'max-len': [
32
- 'error',
33
- {
34
- code: 120,
35
- tabWidth: 2,
36
- ignoreComments: true,
37
- ignoreRegExpLiterals: true,
38
- ignoreStrings: true,
39
- ignoreTrailingComments: true,
40
- },
41
- ],
42
- camelcase: [
43
- 'error',
44
- {
45
- allow: ['Open_Sans'],
46
- },
47
- ],
48
- 'no-shadow': 'off',
49
- 'no-unused-vars': 'off',
50
- 'no-use-before-define': 'off',
51
- 'sort-imports': [
52
- 'error',
53
- {
54
- ignoreDeclarationSort: true,
55
- },
56
- ],
57
- quotes: ['error', 'single', { avoidEscape: true }],
58
- 'object-shorthand': 'error',
59
- 'prefer-const': 'error',
60
- 'class-methods-use-this': 'off',
61
- 'spaced-comment': ['error', 'always'],
62
- 'no-restricted-syntax': [
63
- 'error',
64
- {
65
- selector: 'WithStatement',
66
- message: '`with` statement are not allowed.',
67
- },
68
- {
69
- selector: 'ForInStatement',
70
- message: 'Use for..of instead.',
71
- },
72
- {
73
- selector: 'TSEnumDeclaration',
74
- message: "Don't declare enums, use type union of literal strings or constants.",
75
- },
76
- {
77
- selector: 'MemberExpression[object.name="React"]',
78
- message: 'Use named imports from react.',
79
- },
80
- {
81
- selector:
82
- 'CallExpression[callee.property.name="replaceAll"] > Literal[regex.flags=/^[^g]*$/].arguments:first-child',
83
- message: 'Missing "g" flag in regular expression.',
84
- },
85
- ],
5
+ import { files } from './constants.js'
6
+
7
+ export default config([
8
+ eslint.configs.recommended,
9
+ stylisticJs.configs.all,
10
+ {
11
+ files,
12
+ plugins: { '@stylistic/js': stylisticJs },
13
+ rules: {
14
+ 'no-console': 'warn',
15
+ 'no-debugger': 'warn',
16
+ 'no-undef': 'off',
17
+ 'prefer-template': 'error',
18
+ 'arrow-body-style': ['error', 'as-needed'],
19
+ 'no-return-assign': 'off',
20
+ 'newline-before-return': ['error'],
21
+ radix: 'off',
22
+ camelcase: [
23
+ 'error',
24
+ {
25
+ allow: [],
26
+ },
27
+ ],
28
+ 'no-shadow': 'off',
29
+ 'no-unused-vars': 'off',
30
+ 'no-use-before-define': 'off',
31
+ 'sort-imports': [
32
+ 'error',
33
+ {
34
+ ignoreDeclarationSort: true,
35
+ },
36
+ ],
37
+ 'object-shorthand': 'error',
38
+ 'prefer-const': 'error',
39
+ 'class-methods-use-this': 'off',
40
+ 'no-restricted-syntax': [
41
+ 'error',
42
+ {
43
+ selector: 'WithStatement',
44
+ message: '`with` statement are not allowed.',
45
+ },
46
+ {
47
+ selector: 'ForInStatement',
48
+ message: 'Use for..of instead.',
49
+ },
50
+ {
51
+ selector: 'TSEnumDeclaration',
52
+ message: "Don't declare enums, use type union of literal strings or constants.",
53
+ },
54
+ {
55
+ selector: 'MemberExpression[object.name="React"]',
56
+ message: 'Use named imports from react.',
57
+ },
58
+ {
59
+ selector:
60
+ 'CallExpression[callee.property.name="replaceAll"] > Literal[regex.flags=/^[^g]*$/].arguments:first-child',
61
+ message: 'Missing "g" flag in regular expression.',
62
+ },
63
+ ],
64
+ curly: ['error', 'all'],
65
+ // @stylistic
66
+ '@stylistic/js/object-curly-newline': 'off',
67
+ '@stylistic/js/operator-linebreak': 'off',
68
+ '@stylistic/js/function-paren-newline': 'off',
69
+ '@stylistic/js/no-confusing-arrow': 'off',
70
+ '@stylistic/js/newline-per-chained-call': 'off',
71
+ '@stylistic/js/indent': 'off',
72
+ '@stylistic/js/implicit-arrow-linebreak': 'off',
73
+ '@stylistic/js/lines-between-class-members': [
74
+ 'error',
75
+ 'always',
76
+ {
77
+ exceptAfterSingleLine: true,
78
+ },
79
+ ],
80
+ '@stylistic/js/no-mixed-operators': 'off',
81
+ '@stylistic/js/max-len': [
82
+ 'error',
83
+ {
84
+ code: 120,
85
+ tabWidth: 2,
86
+ ignoreComments: true,
87
+ ignoreRegExpLiterals: true,
88
+ ignoreStrings: true,
89
+ ignoreTrailingComments: true,
90
+ },
91
+ ],
92
+ '@stylistic/js/quotes': ['error', 'single', { avoidEscape: true }],
93
+ '@stylistic/js/spaced-comment': ['error', 'always'],
94
+ '@stylistic/js/object-curly-spacing': ['error', 'always', { objectsInObjects: true }],
95
+ '@stylistic/js/padding-line-between-statements': [
96
+ 'error',
97
+ { blankLine: 'always', prev: '*', next: 'if' },
98
+ { blankLine: 'always', prev: 'if', next: 'if' },
99
+ { blankLine: 'always', prev: ['const', 'let'], next: '*' },
100
+ { blankLine: 'any', prev: ['const', 'let'], next: ['const', 'let'] },
101
+ { blankLine: 'always', prev: '*', next: 'return' },
102
+ { blankLine: 'always', prev: '*', next: 'case' },
103
+ { blankLine: 'always', prev: 'if', next: '*' },
104
+ ],
105
+ },
86
106
  },
87
- })
107
+ ])
@@ -1,44 +1,55 @@
1
1
  import importPlugin from 'eslint-plugin-import'
2
- import tseslint from 'typescript-eslint'
2
+ import { config } from 'typescript-eslint'
3
3
 
4
- export default tseslint.config({
5
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
6
- plugins: { import: importPlugin },
7
- rules: {
8
- 'import/newline-after-import': 'error',
9
- 'import/order': [
10
- 'error',
11
- {
12
- 'newlines-between': 'always',
13
- groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
14
- pathGroups: [
15
- {
16
- pattern: '@/**',
17
- group: 'external',
18
- position: 'after',
4
+ import { files } from './constants.js'
5
+
6
+ export default config([
7
+ importPlugin.flatConfigs.recommended,
8
+ importPlugin.flatConfigs.typescript,
9
+ {
10
+ files,
11
+ rules: {
12
+ 'import/newline-after-import': 'error',
13
+ 'import/order': [
14
+ 'error',
15
+ {
16
+ 'newlines-between': 'always',
17
+ groups: [['builtin', 'external'], ['internal'], ['parent'], ['sibling', 'index', 'object'], ['type']],
18
+ pathGroups: [
19
+ {
20
+ pattern: '@/**',
21
+ group: 'external',
22
+ position: 'after',
23
+ },
24
+ ],
25
+ alphabetize: {
26
+ order: 'asc',
27
+ caseInsensitive: false,
19
28
  },
20
- ],
21
- alphabetize: {
22
- order: 'asc',
23
- caseInsensitive: false,
24
29
  },
30
+ ],
31
+ 'import/no-duplicates': [
32
+ 'error',
33
+ {
34
+ considerQueryString: true,
35
+ },
36
+ ],
37
+ 'import/prefer-default-export': 'off',
38
+ 'import/extensions': [
39
+ 'error',
40
+ 'never',
41
+ {
42
+ js: 'never',
43
+ json: 'ignorePackages',
44
+ },
45
+ ],
46
+ 'import/no-unresolved': ['error', {}],
47
+ },
48
+ settings: {
49
+ 'import/resolver': {
50
+ typescript: true,
51
+ node: true,
25
52
  },
26
- ],
27
- 'import/no-duplicates': [
28
- 'error',
29
- {
30
- considerQueryString: true,
31
- },
32
- ],
33
- 'import/prefer-default-export': 'off',
34
- 'import/extensions': [
35
- 'error',
36
- 'never',
37
- {
38
- js: 'never',
39
- json: 'ignorePackages',
40
- },
41
- ],
42
- 'import/no-unresolved': ['error', {}],
53
+ },
43
54
  },
44
- })
55
+ ])
@@ -1,13 +1,17 @@
1
1
  import nextPlugin from '@next/eslint-plugin-next'
2
- import tseslint from 'typescript-eslint'
2
+ import { config } from 'typescript-eslint'
3
3
 
4
- export default tseslint.config({
5
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
6
- plugins: {
7
- '@next/next': nextPlugin,
8
- },
9
- rules: {
10
- ...nextPlugin.configs.recommended.rules,
11
- ...nextPlugin.configs['core-web-vitals'].rules,
4
+ import { files } from './constants.js'
5
+
6
+ export default config([
7
+ {
8
+ files,
9
+ plugins: {
10
+ '@next/next': nextPlugin,
11
+ },
12
+ rules: {
13
+ ...nextPlugin.configs.recommended.rules,
14
+ ...nextPlugin.configs['core-web-vitals'].rules,
15
+ },
12
16
  },
13
- })
17
+ ])
@@ -1,10 +1,14 @@
1
1
  import prettierConfig from 'eslint-config-prettier'
2
2
  import prettierPlugin from 'eslint-plugin-prettier'
3
- import tseslint from 'typescript-eslint'
3
+ import { config } from 'typescript-eslint'
4
4
 
5
- export default tseslint.config({
6
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
7
- extends: [prettierConfig],
8
- plugins: { prettier: prettierPlugin },
9
- rules: { 'prettier/prettier': 'error' },
10
- })
5
+ import { files } from './constants.js'
6
+
7
+ export default config([
8
+ prettierConfig,
9
+ {
10
+ files,
11
+ plugins: { prettier: prettierPlugin },
12
+ rules: { 'prettier/prettier': 'error' },
13
+ },
14
+ ])
@@ -1,51 +1,59 @@
1
- import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
2
- import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
1
+ import stylisticJsx from '@stylistic/eslint-plugin-jsx'
2
+ import reactPlugin from 'eslint-plugin-react'
3
3
  import reactHooksPlugin from 'eslint-plugin-react-hooks'
4
- import tseslint from 'typescript-eslint'
4
+ import { config } from 'typescript-eslint'
5
5
 
6
- export default tseslint.config({
7
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
8
- plugins: { 'react-hooks': reactHooksPlugin },
9
- extends: [reactRecommended, reactJsxRuntime],
10
- rules: {
11
- 'react/boolean-prop-naming': 'error',
12
- 'react/button-has-type': 'error',
13
- 'react/checked-requires-onchange-or-readonly': 'error',
14
- 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
15
- 'react/destructuring-assignment': 'error',
16
- 'react/function-component-definition': [
17
- 'error',
18
- {
19
- namedComponents: 'arrow-function',
20
- unnamedComponents: 'arrow-function',
21
- },
22
- ],
23
- 'react/hook-use-state': 'error',
24
- 'react/jsx-boolean-value': 'error',
25
- 'react/jsx-closing-bracket-location': 'error',
26
- 'react/jsx-closing-tag-location': 'error',
27
- 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
28
- 'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
29
- 'react/jsx-curly-spacing': [
30
- 'error',
31
- {
32
- when: 'never',
33
- attributes: { allowMultiline: false },
34
- children: false,
35
- },
36
- ],
37
- 'react/jsx-equals-spacing': ['error', 'never'],
38
- 'react/jsx-first-prop-new-line': ['error', 'multiline'],
39
- 'react/jsx-fragments': 'error',
40
- 'react/jsx-handler-names': 'error',
41
- 'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
42
- 'react/jsx-no-constructed-context-values': 'error',
43
- 'react/jsx-no-leaked-render': 'error',
44
- 'react/jsx-no-useless-fragment': 'error',
45
- 'react/jsx-props-no-multi-spaces': 'error',
46
- 'react/jsx-tag-spacing': 'error',
47
- 'react/no-multi-comp': 'error',
48
- 'react/self-closing-comp': ['error', { component: true, html: true }],
49
- ...reactHooksPlugin.configs.recommended.rules,
6
+ import { files } from './constants.js'
7
+
8
+ export default config([
9
+ reactPlugin.configs.flat.recommended,
10
+ reactPlugin.configs.flat['jsx-runtime'],
11
+ stylisticJsx.configs.recommended,
12
+ {
13
+ files,
14
+ plugins: { 'react-hooks': reactHooksPlugin },
15
+ rules: {
16
+ 'react/boolean-prop-naming': 'error',
17
+ 'react/button-has-type': 'error',
18
+ 'react/checked-requires-onchange-or-readonly': 'error',
19
+ 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
20
+ 'react/destructuring-assignment': 'error',
21
+ 'react/function-component-definition': [
22
+ 'error',
23
+ {
24
+ namedComponents: 'arrow-function',
25
+ unnamedComponents: 'arrow-function',
26
+ },
27
+ ],
28
+ 'react/hook-use-state': 'error',
29
+ 'react/jsx-boolean-value': 'error',
30
+ 'react/jsx-fragments': 'error',
31
+ 'react/jsx-handler-names': 'error',
32
+ 'react/jsx-no-constructed-context-values': 'error',
33
+ 'react/jsx-no-leaked-render': 'error',
34
+ 'react/jsx-no-useless-fragment': 'error',
35
+ 'react/no-multi-comp': 'error',
36
+ 'react/self-closing-comp': ['error', { component: true, html: true }],
37
+
38
+ ...reactHooksPlugin.configs.recommended.rules,
39
+ // @stylistic
40
+ '@stylistic/jsx/jsx-closing-bracket-location': 'error',
41
+ '@stylistic/jsx/jsx-closing-tag-location': 'error',
42
+ '@stylistic/jsx/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
43
+ '@stylistic/jsx/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
44
+ '@stylistic/jsx/jsx-curly-spacing': [
45
+ 'error',
46
+ {
47
+ when: 'never',
48
+ attributes: { allowMultiline: false },
49
+ children: false,
50
+ },
51
+ ],
52
+ '@stylistic/jsx/jsx-equals-spacing': ['error', 'never'],
53
+ '@stylistic/jsx/jsx-first-prop-new-line': ['error', 'multiline'],
54
+ '@stylistic/jsx/jsx-max-props-per-line': ['error', { when: 'multiline' }],
55
+ '@stylistic/jsx/jsx-props-no-multi-spaces': 'error',
56
+ '@stylistic/jsx/jsx-tag-spacing': 'error',
57
+ },
50
58
  },
51
- })
59
+ ])
@@ -1,7 +1,14 @@
1
- import sonarjs from 'eslint-plugin-sonarjs'
2
- import tseslint from 'typescript-eslint'
1
+ import { configs } from 'eslint-plugin-sonarjs'
2
+ import { config } from 'typescript-eslint'
3
3
 
4
- export default tseslint.config({
5
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
6
- extends: [sonarjs.configs.recommended],
7
- })
4
+ import { files } from './constants.js'
5
+
6
+ export default config([
7
+ configs.recommended,
8
+ {
9
+ files,
10
+ rules: {
11
+ 'sonarjs/todo-tag': 'warn',
12
+ },
13
+ },
14
+ ])
@@ -1,29 +1,29 @@
1
- import tseslint from 'typescript-eslint'
1
+ import { config, configs } from 'typescript-eslint'
2
2
 
3
- export default tseslint.config({
4
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
5
- extends: [...tseslint.configs.recommended, ...tseslint.configs.stylistic],
6
- languageOptions: {
7
- parserOptions: {
8
- project: ['tsconfig.json'],
3
+ import { files } from './constants.js'
4
+
5
+ export default config([
6
+ ...configs.recommended,
7
+ ...configs.stylistic,
8
+ {
9
+ files,
10
+ languageOptions: {
11
+ parserOptions: {
12
+ project: ['tsconfig.json'],
13
+ },
9
14
  },
10
- },
11
- settings: {
12
- 'import/resolver': {
13
- typescript: {},
15
+ rules: {
16
+ '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
17
+ '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
18
+ '@typescript-eslint/ban-ts-comment': [
19
+ 'error',
20
+ {
21
+ 'ts-expect-error': 'allow-with-description',
22
+ 'ts-ignore': 'allow-with-description',
23
+ },
24
+ ],
25
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
26
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
14
27
  },
15
28
  },
16
- rules: {
17
- '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
18
- '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
19
- '@typescript-eslint/ban-ts-comment': [
20
- 'error',
21
- {
22
- 'ts-expect-error': 'allow-with-description',
23
- 'ts-ignore': 'allow-with-description',
24
- },
25
- ],
26
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
27
- '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
28
- },
29
- })
29
+ ])
@@ -1,25 +1,29 @@
1
1
  import unicornPlugin from 'eslint-plugin-unicorn'
2
- import tseslint from 'typescript-eslint'
2
+ import { config } from 'typescript-eslint'
3
3
 
4
- export default tseslint.config({
5
- files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.vue', '**/*.svelte'],
6
- extends: [unicornPlugin.configs['flat/recommended']],
7
- rules: {
8
- 'unicorn/consistent-destructuring': 'error',
9
- 'unicorn/custom-error-definition': 'error',
10
- 'unicorn/no-unused-properties': 'error',
11
- 'unicorn/prevent-abbreviations': [
12
- 'error',
13
- {
14
- checkShorthandImports: false,
15
- replacements: {
16
- dev: false,
17
- prod: false,
18
- props: false,
19
- ref: false,
20
- refs: false,
4
+ import { files } from './constants.js'
5
+
6
+ export default config([
7
+ unicornPlugin.configs.recommended,
8
+ {
9
+ files,
10
+ rules: {
11
+ 'unicorn/consistent-destructuring': 'error',
12
+ 'unicorn/custom-error-definition': 'error',
13
+ 'unicorn/no-unused-properties': 'error',
14
+ 'unicorn/prevent-abbreviations': [
15
+ 'error',
16
+ {
17
+ checkShorthandImports: false,
18
+ replacements: {
19
+ dev: false,
20
+ prod: false,
21
+ props: false,
22
+ ref: false,
23
+ refs: false,
24
+ },
21
25
  },
22
- },
23
- ],
26
+ ],
27
+ },
24
28
  },
25
- })
29
+ ])
@@ -0,0 +1 @@
1
+ export const files = ['**/*.{js,jsx,ts,tsx,mts,cts,mjs,cjs,vue,svelte}']
@@ -2,6 +2,14 @@ import commonConfig from './configs/config.common.js'
2
2
  import importConfig from './configs/config.import.js'
3
3
  import prettierConfig from './configs/config.prettier.js'
4
4
  import sonarjsConfig from './configs/config.sonarjs.js'
5
+ import typescriptConfig from './configs/config.typescript.js'
5
6
  import unicornConfig from './configs/config.unicorn.js'
6
7
 
7
- export default [...prettierConfig, ...commonConfig, ...importConfig, ...unicornConfig, ...sonarjsConfig]
8
+ export default [
9
+ ...commonConfig,
10
+ ...importConfig,
11
+ ...typescriptConfig,
12
+ ...prettierConfig,
13
+ ...unicornConfig,
14
+ ...sonarjsConfig,
15
+ ]
@@ -1,4 +1,4 @@
1
1
  import reactConfig from './configs/config.react.js'
2
- import typescriptConfig from './eslint.config.typescript.js'
2
+ import commonConfig from './eslint.config.common.js'
3
3
 
4
- export default [...typescriptConfig, ...reactConfig]
4
+ export default [...commonConfig, ...reactConfig]
@@ -0,0 +1 @@
1
+ export {}
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export { default as eslintCommon } from './eslint/eslint.config.common.js'
2
- export { default as eslintTypescript } from './eslint/eslint.config.typescript.js'
3
2
  export { default as eslintReact } from './eslint/eslint.config.react.js'
4
3
  export { default as eslintNext } from './eslint/eslint.config.next.js'
5
4
 
package/eslint.config.js DELETED
@@ -1,11 +0,0 @@
1
- import common from './src/eslint/eslint.config.common.js'
2
-
3
- export default [
4
- ...common,
5
- {
6
- rules: {
7
- 'import/extensions': 'off',
8
- },
9
- ignores: ['dist/*'],
10
- },
11
- ]
@@ -1,5 +0,0 @@
1
- import prettier from './src/prettier/prettier.config.common.js'
2
-
3
- export default {
4
- ...prettier,
5
- }
@@ -1,18 +0,0 @@
1
- import angular from 'angular-eslint'
2
- import tseslint from 'typescript-eslint'
3
-
4
- export default tseslint.config(
5
- {
6
- files: ['**/*.ts'],
7
- extends: [...angular.configs.tsAll],
8
- processor: angular.processInlineTemplates,
9
- },
10
- {
11
- files: ['**/*.html'],
12
- extends: [...angular.configs.templateAll],
13
- rules: {
14
- '@angular-eslint/template/i18n': 'off',
15
- '@angular-eslint/template/no-call-expression': ['error', { allowPrefix: '$' }],
16
- },
17
- },
18
- )
@@ -1,17 +0,0 @@
1
- import sveltePlugin from 'eslint-plugin-svelte'
2
- import svelteParser from 'svelte-eslint-parser'
3
- import tseslint from 'typescript-eslint'
4
-
5
- export default tseslint.config({
6
- files: ['**/*.svelte', '*.svelte'],
7
- extends: [...sveltePlugin.configs['flat/recommended']],
8
- languageOptions: {
9
- parser: svelteParser,
10
- parserOptions: {
11
- parser: {
12
- ts: '@typescript-eslint/parser',
13
- },
14
- extraFileExtensions: ['.svelte'],
15
- },
16
- },
17
- })
@@ -1,4 +0,0 @@
1
- import angularConfig from './configs/config.angular.js'
2
- import typescriptConfig from './eslint.config.typescript.js'
3
-
4
- export default [...typescriptConfig, ...angularConfig]
@@ -1,4 +0,0 @@
1
- import svelteConfig from './configs/config.svelte.js'
2
- import typescriptConfig from './eslint.config.typescript.js'
3
-
4
- export default [...typescriptConfig, ...svelteConfig]
@@ -1,4 +0,0 @@
1
- import typescriptConfig from './configs/config.typescript.js'
2
- import commonConfig from './eslint.config.common.js'
3
-
4
- export default [...commonConfig, ...typescriptConfig]