@st1ggy/linter-config 1.0.20 → 1.0.22

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.
@@ -3,103 +3,105 @@ import prettierConfig from 'eslint-config-prettier'
3
3
  import importPlugin from 'eslint-plugin-import'
4
4
  import prettierPlugin from 'eslint-plugin-prettier'
5
5
 
6
- export default {
7
- plugins: {
8
- import: importPlugin,
9
- prettier: prettierPlugin,
10
- },
11
- rules: {
12
- ...eslint.configs.recommended.rules,
13
- ...prettierConfig.rules,
14
- 'no-console': 'warn',
15
- 'no-debugger': 'warn',
16
- 'prettier/prettier': 'error',
17
- 'object-curly-newline': 'off',
18
- 'operator-linebreak': 'off',
19
- 'function-paren-newline': 'off',
20
- 'no-confusing-arrow': 'off',
21
- 'newline-per-chained-call': 'off',
22
- indent: 'off',
23
- 'implicit-arrow-linebreak': 'off',
24
- 'no-undef': 'off',
25
- 'lines-between-class-members': [
26
- 'error',
27
- 'always',
28
- {
29
- exceptAfterSingleLine: true,
30
- },
31
- ],
32
- 'prefer-template': 'error',
33
- 'arrow-body-style': ['error', 'as-needed'],
34
- 'no-return-assign': 'off',
35
- 'newline-before-return': ['error'],
36
- radix: 'off',
37
- 'no-mixed-operators': 'off',
38
- 'max-len': [
39
- 'error',
40
- {
41
- code: 120,
42
- tabWidth: 2,
43
- ignoreComments: true,
44
- ignoreRegExpLiterals: true,
45
- ignoreStrings: true,
46
- ignoreTrailingComments: true,
47
- },
48
- ],
49
- camelcase: [
50
- 'error',
51
- {
52
- allow: ['Open_Sans'],
53
- },
54
- ],
55
- 'no-shadow': 'off',
56
- 'no-unused-vars': 'off',
57
- 'no-use-before-define': 'off',
58
- 'import/newline-after-import': 'error',
59
- 'sort-imports': [
60
- 'error',
61
- {
62
- ignoreDeclarationSort: true,
63
- },
64
- ],
65
- 'import/order': [
66
- 'error',
67
- {
68
- 'newlines-between': 'always',
69
- groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
70
- pathGroups: [
71
- {
72
- pattern: '@/**',
73
- group: 'external',
74
- position: 'after',
6
+ export default [
7
+ eslint.configs.recommended,
8
+ prettierConfig,
9
+ {
10
+ plugins: {
11
+ import: importPlugin,
12
+ prettier: prettierPlugin,
13
+ },
14
+ rules: {
15
+ 'no-console': 'warn',
16
+ 'no-debugger': 'warn',
17
+ 'prettier/prettier': 'error',
18
+ 'object-curly-newline': 'off',
19
+ 'operator-linebreak': 'off',
20
+ 'function-paren-newline': 'off',
21
+ 'no-confusing-arrow': 'off',
22
+ 'newline-per-chained-call': 'off',
23
+ indent: 'off',
24
+ 'implicit-arrow-linebreak': 'off',
25
+ 'no-undef': 'off',
26
+ 'lines-between-class-members': [
27
+ 'error',
28
+ 'always',
29
+ {
30
+ exceptAfterSingleLine: true,
31
+ },
32
+ ],
33
+ 'prefer-template': 'error',
34
+ 'arrow-body-style': ['error', 'as-needed'],
35
+ 'no-return-assign': 'off',
36
+ 'newline-before-return': ['error'],
37
+ radix: 'off',
38
+ 'no-mixed-operators': 'off',
39
+ 'max-len': [
40
+ 'error',
41
+ {
42
+ code: 120,
43
+ tabWidth: 2,
44
+ ignoreComments: true,
45
+ ignoreRegExpLiterals: true,
46
+ ignoreStrings: true,
47
+ ignoreTrailingComments: true,
48
+ },
49
+ ],
50
+ camelcase: [
51
+ 'error',
52
+ {
53
+ allow: ['Open_Sans'],
54
+ },
55
+ ],
56
+ 'no-shadow': 'off',
57
+ 'no-unused-vars': 'off',
58
+ 'no-use-before-define': 'off',
59
+ 'import/newline-after-import': 'error',
60
+ 'sort-imports': [
61
+ 'error',
62
+ {
63
+ ignoreDeclarationSort: true,
64
+ },
65
+ ],
66
+ 'import/order': [
67
+ 'error',
68
+ {
69
+ 'newlines-between': 'always',
70
+ groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
71
+ pathGroups: [
72
+ {
73
+ pattern: '@/**',
74
+ group: 'external',
75
+ position: 'after',
76
+ },
77
+ ],
78
+ alphabetize: {
79
+ order: 'asc',
80
+ caseInsensitive: false,
75
81
  },
76
- ],
77
- alphabetize: {
78
- order: 'asc',
79
- caseInsensitive: false,
80
82
  },
81
- },
82
- ],
83
- quotes: ['error', 'single'],
84
- 'import/no-duplicates': [
85
- 'error',
86
- {
87
- considerQueryString: true,
88
- },
89
- ],
90
- 'object-shorthand': 'error',
91
- 'prefer-const': 'error',
92
- 'class-methods-use-this': 'off',
93
- 'import/prefer-default-export': 'off',
94
- 'import/extensions': [
95
- 'error',
96
- 'never',
97
- {
98
- js: 'never',
99
- json: 'ignorePackages',
100
- },
101
- ],
102
- 'import/no-unresolved': ['error', {}],
103
- 'spaced-comment': ['error', 'always'],
83
+ ],
84
+ quotes: ['error', 'single'],
85
+ 'import/no-duplicates': [
86
+ 'error',
87
+ {
88
+ considerQueryString: true,
89
+ },
90
+ ],
91
+ 'object-shorthand': 'error',
92
+ 'prefer-const': 'error',
93
+ 'class-methods-use-this': 'off',
94
+ 'import/prefer-default-export': 'off',
95
+ 'import/extensions': [
96
+ 'error',
97
+ 'never',
98
+ {
99
+ js: 'never',
100
+ json: 'ignorePackages',
101
+ },
102
+ ],
103
+ 'import/no-unresolved': ['error', {}],
104
+ 'spaced-comment': ['error', 'always'],
105
+ },
104
106
  },
105
- }
107
+ ]
@@ -3,55 +3,55 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks'
3
3
 
4
4
  import typescript from './eslint.config.typescript.js'
5
5
 
6
- export default {
7
- ...typescript,
8
- plugins: {
9
- ...typescript.plugins,
10
- react: reactPlugin,
11
- 'react-hooks': reactHooksPlugin,
6
+ export default [
7
+ typescript,
8
+ {
9
+ plugins: {
10
+ react: reactPlugin,
11
+ 'react-hooks': reactHooksPlugin,
12
+ },
13
+ rules: {
14
+ 'react/sort-comp': 'off',
15
+ 'react/prop-types': 'off',
16
+ 'react/jsx-curly-newline': 'off',
17
+ 'react/state-in-constructor': 'off',
18
+ 'react/require-default-props': 'off',
19
+ 'react/jsx-props-no-spreading': 'off',
20
+ 'react/jsx-filename-extension': 'off',
21
+ 'react/destructuring-assignment': 'off',
22
+ 'react/static-property-placement': 'off',
23
+ 'react/jsx-one-expression-per-line': 'off',
24
+ 'react/self-closing-comp': [
25
+ 'error',
26
+ {
27
+ component: true,
28
+ html: true,
29
+ },
30
+ ],
31
+ 'react/default-props-match-prop-types': [
32
+ 'warn',
33
+ {
34
+ allowRequiredDefaults: true,
35
+ },
36
+ ],
37
+ 'react/jsx-wrap-multilines': 'off',
38
+ 'react/jsx-indent': 'off',
39
+ 'react-hooks/rules-of-hooks': 'error',
40
+ 'react-hooks/exhaustive-deps': 'error',
41
+ 'react/function-component-definition': [
42
+ 'error',
43
+ {
44
+ namedComponents: 'arrow-function',
45
+ unnamedComponents: 'arrow-function',
46
+ },
47
+ ],
48
+ 'react/jsx-curly-brace-presence': [
49
+ 'warn',
50
+ {
51
+ props: 'never',
52
+ children: 'never',
53
+ },
54
+ ],
55
+ },
12
56
  },
13
- rules: {
14
- ...typescript.rules,
15
- 'react/sort-comp': 'off',
16
- 'react/prop-types': 'off',
17
- 'react/jsx-curly-newline': 'off',
18
- 'react/state-in-constructor': 'off',
19
- 'react/require-default-props': 'off',
20
- 'react/jsx-props-no-spreading': 'off',
21
- 'react/jsx-filename-extension': 'off',
22
- 'react/destructuring-assignment': 'off',
23
- 'react/static-property-placement': 'off',
24
- 'react/jsx-one-expression-per-line': 'off',
25
- 'react/self-closing-comp': [
26
- 'error',
27
- {
28
- component: true,
29
- html: true,
30
- },
31
- ],
32
- 'react/default-props-match-prop-types': [
33
- 'warn',
34
- {
35
- allowRequiredDefaults: true,
36
- },
37
- ],
38
- 'react/jsx-wrap-multilines': 'off',
39
- 'react/jsx-indent': 'off',
40
- 'react-hooks/rules-of-hooks': 'error',
41
- 'react-hooks/exhaustive-deps': 'error',
42
- 'react/function-component-definition': [
43
- 'error',
44
- {
45
- namedComponents: 'arrow-function',
46
- unnamedComponents: 'arrow-function',
47
- },
48
- ],
49
- 'react/jsx-curly-brace-presence': [
50
- 'warn',
51
- {
52
- props: 'never',
53
- children: 'never',
54
- },
55
- ],
56
- },
57
- }
57
+ ]
@@ -1,54 +1,42 @@
1
- import tsPlugin from '@typescript-eslint/eslint-plugin'
2
- import parser from '@typescript-eslint/parser'
1
+ import tseslint from 'typescript-eslint'
3
2
 
4
3
  import common from './eslint.config.common.js'
5
4
 
6
- export default {
7
- ...common,
8
- plugins: {
9
- ...common.plugins,
10
- '@typescript-eslint': tsPlugin,
11
- },
12
- languageOptions: {
13
- ecmaVersion: 'latest',
14
- parser,
15
- sourceType: 'module',
16
- parserOptions: {
17
- project: ['tsconfig.json'],
5
+ export default tseslint.config(...tseslint.configs.strict, ...tseslint.configs.stylistic, [
6
+ common,
7
+ {
8
+ rules: {
9
+ '@typescript-eslint/no-explicit-any': 'off',
10
+ '@typescript-eslint/ban-types': ['warn'],
11
+ '@typescript-eslint/no-shadow': [
12
+ 'error',
13
+ {
14
+ ignoreTypeValueShadow: true,
15
+ },
16
+ ],
17
+ '@typescript-eslint/no-var-requires': ['off'],
18
+ '@typescript-eslint/no-empty-function': ['off'],
19
+ '@typescript-eslint/no-use-before-define': ['error'],
20
+ '@typescript-eslint/no-unused-vars': [
21
+ 'error',
22
+ {
23
+ ignoreRestSiblings: true,
24
+ },
25
+ ],
26
+ '@typescript-eslint/ban-ts-comment': [
27
+ 'error',
28
+ {
29
+ 'ts-expect-error': 'allow-with-description',
30
+ 'ts-ignore': 'allow-with-description',
31
+ },
32
+ ],
33
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
34
+ '@typescript-eslint/consistent-type-imports': [
35
+ 'error',
36
+ {
37
+ fixStyle: 'inline-type-imports',
38
+ },
39
+ ],
18
40
  },
19
41
  },
20
- rules: {
21
- ...common.rules,
22
- '@typescript-eslint/no-explicit-any': 'off',
23
- '@typescript-eslint/ban-types': ['warn'],
24
- '@typescript-eslint/no-shadow': [
25
- 'error',
26
- {
27
- ignoreTypeValueShadow: true,
28
- },
29
- ],
30
- '@typescript-eslint/no-var-requires': ['off'],
31
- '@typescript-eslint/no-empty-function': ['off'],
32
- '@typescript-eslint/no-use-before-define': ['error'],
33
- '@typescript-eslint/no-unused-vars': [
34
- 'error',
35
- {
36
- ignoreRestSiblings: true,
37
- },
38
- ],
39
- '@typescript-eslint/ban-ts-comment': [
40
- 'error',
41
- {
42
- 'ts-expect-error': 'allow-with-description',
43
- 'ts-ignore': 'allow-with-description',
44
- },
45
- ],
46
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
47
- '@typescript-eslint/consistent-type-imports': [
48
- 'error',
49
- {
50
- fixStyle: 'inline-type-imports',
51
- },
52
- ],
53
- },
54
- }
42
+ ])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -26,17 +26,17 @@
26
26
  "dist"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@eslint/js": "9.2.0",
30
- "@typescript-eslint/eslint-plugin": "7.8.0",
31
- "@typescript-eslint/parser": "7.8.0",
32
- "eslint": "8.57.0",
29
+ "@eslint/js": "8.57.0",
30
+ "eslint": "^8.57.0",
33
31
  "eslint-config-next": "14.2.3",
34
32
  "eslint-config-prettier": "9.1.0",
35
33
  "eslint-plugin-import": "2.29.1",
36
34
  "eslint-plugin-prettier": "5.1.3",
37
35
  "eslint-plugin-react": "7.34.1",
38
36
  "eslint-plugin-react-hooks": "5.1.0-canary-fd0da3eef-20240404",
39
- "prettier": "3.2.5"
37
+ "prettier": "3.2.5",
38
+ "typescript": "5.4.5",
39
+ "typescript-eslint": "7.8.0"
40
40
  },
41
41
  "type": "module"
42
42
  }