@st1ggy/linter-config 1.0.49 → 1.0.51

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/eslint.config.js CHANGED
@@ -1,9 +1,7 @@
1
1
  import common from './src/eslint/eslint.config.common.js'
2
- import react from './src/eslint/eslint.config.react.js'
3
2
 
4
3
  export default [
5
- // ...common,
6
- ...react,
4
+ ...common,
7
5
  {
8
6
  rules: {
9
7
  'import/extensions': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -1,56 +1,4 @@
1
- import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
2
- import reactHooksPlugin from 'eslint-plugin-react-hooks'
3
-
1
+ import reactRules from './rules/rules.react.js'
4
2
  import typescript from './eslint.config.typescript.js'
5
3
 
6
- export default [
7
- ...typescript,
8
- reactRecommended,
9
- // reactHooksPlugin.configs.recommended,
10
- {
11
- plugins: { 'react-hooks': reactHooksPlugin },
12
- rules: {
13
- 'react/boolean-prop-naming': 'error',
14
- 'react/button-has-type': 'error',
15
- 'react/checked-requires-onchange-or-readonly': 'error',
16
- 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
17
- 'react/destructuring-assignment': 'error',
18
- 'react/function-component-definition': [
19
- 'error',
20
- {
21
- namedComponents: 'arrow-function',
22
- unnamedComponents: 'arrow-function',
23
- },
24
- ],
25
- 'react/hook-use-state': 'error',
26
- 'react/jsx-boolean-value': 'error',
27
- 'react/jsx-child-element-spacing': 'error',
28
- 'react/jsx-closing-bracket-location': 'error',
29
- 'react/jsx-closing-tag-location': 'error',
30
- 'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
31
- 'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
32
- 'react/jsx-curly-spacing': [
33
- 'error',
34
- {
35
- when: 'never',
36
- attributes: { allowMultiline: false },
37
- children: false,
38
- },
39
- ],
40
- 'react/jsx-equals-spacing': ['error', 'never'],
41
- 'react/jsx-first-prop-new-line': ['error', 'multiline'],
42
- 'react/jsx-fragments': 'error',
43
- 'react/jsx-handler-names': 'error',
44
- 'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
45
- 'react/jsx-no-constructed-context-values': 'error',
46
- 'react/jsx-no-leaked-render': 'error',
47
- 'react/jsx-no-useless-fragment': 'error',
48
- 'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
49
- 'react/jsx-props-no-multi-spaces': 'error',
50
- 'react/jsx-tag-spacing': 'error',
51
- 'react/no-multi-comp': 'error',
52
- 'react/self-closing-comp': ['error', { component: true, html: true }],
53
- ...reactHooksPlugin.configs.recommended.rules,
54
- },
55
- },
56
- ]
4
+ export default [...typescript, ...reactRules]
@@ -1,29 +1,11 @@
1
1
  import tseslint from 'typescript-eslint'
2
2
 
3
+ import typescriptRules from './rules/rules.typescript.js'
3
4
  import common from './eslint.config.common.js'
4
5
 
5
- export default tseslint.config(...tseslint.configs.recommended, ...tseslint.configs.stylistic, ...common, {
6
- languageOptions: {
7
- parserOptions: {
8
- project: ['tsconfig.json'],
9
- },
10
- },
11
- settings: {
12
- 'import/resolver': {
13
- typescript: {},
14
- },
15
- },
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
- })
6
+ export default tseslint.config(
7
+ ...common,
8
+ ...tseslint.configs.recommended,
9
+ ...tseslint.configs.stylistic,
10
+ ...typescriptRules,
11
+ )
@@ -0,0 +1,53 @@
1
+ import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
2
+ import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
3
+
4
+ export default [
5
+ reactRecommended,
6
+ reactJsxRuntime,
7
+ {
8
+ plugins: { 'react-hooks': reactHooksPlugin },
9
+ rules: {
10
+ 'react/boolean-prop-naming': 'error',
11
+ 'react/button-has-type': 'error',
12
+ 'react/checked-requires-onchange-or-readonly': 'error',
13
+ 'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
14
+ 'react/destructuring-assignment': 'error',
15
+ 'react/function-component-definition': [
16
+ 'error',
17
+ {
18
+ namedComponents: 'arrow-function',
19
+ unnamedComponents: 'arrow-function',
20
+ },
21
+ ],
22
+ 'react/hook-use-state': 'error',
23
+ 'react/jsx-boolean-value': 'error',
24
+ 'react/jsx-child-element-spacing': '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-one-expression-per-line': ['error', { allow: 'single-child' }],
46
+ 'react/jsx-props-no-multi-spaces': 'error',
47
+ 'react/jsx-tag-spacing': 'error',
48
+ 'react/no-multi-comp': 'error',
49
+ 'react/self-closing-comp': ['error', { component: true, html: true }],
50
+ ...reactHooksPlugin.configs.recommended.rules,
51
+ },
52
+ },
53
+ ]
@@ -0,0 +1,27 @@
1
+ export default [
2
+ {
3
+ languageOptions: {
4
+ parserOptions: {
5
+ project: ['tsconfig.json'],
6
+ },
7
+ },
8
+ settings: {
9
+ 'import/resolver': {
10
+ typescript: {},
11
+ },
12
+ },
13
+ rules: {
14
+ '@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
15
+ '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
16
+ '@typescript-eslint/ban-ts-comment': [
17
+ 'error',
18
+ {
19
+ 'ts-expect-error': 'allow-with-description',
20
+ 'ts-ignore': 'allow-with-description',
21
+ },
22
+ ],
23
+ '@typescript-eslint/switch-exhaustiveness-check': 'error',
24
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
25
+ },
26
+ },
27
+ ]