@faergeek/eslint-config 6.0.17 → 7.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ import { node } from './index.js';
2
+
3
+ export default node;
package/index.js CHANGED
@@ -1,37 +1,121 @@
1
- module.exports = {
2
- reportUnusedDisableDirectives: true,
3
- extends: ['eslint:recommended', 'prettier'],
4
- plugins: ['simple-import-sort'],
5
- parserOptions: { sourceType: 'module' },
6
- env: { es2022: true },
7
- rules: {
8
- 'dot-notation': 'warn',
9
- eqeqeq: ['warn', 'smart'],
10
- 'func-names': ['warn', 'as-needed'],
11
- 'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
12
- 'no-alert': 'warn',
13
- 'no-console': 'warn',
14
- 'no-shadow': 'warn',
15
- 'no-throw-literal': 'warn',
16
- 'no-unused-vars': ['warn', { ignoreRestSiblings: true }],
17
- 'no-useless-computed-key': 'warn',
18
- 'no-useless-concat': 'warn',
19
- 'no-useless-rename': 'warn',
20
- 'object-shorthand': 'warn',
21
- 'operator-assignment': 'warn',
22
- 'prefer-const': ['warn', { destructuring: 'all' }],
23
- 'prefer-template': 'warn',
24
- radix: 'warn',
25
- 'spaced-comment': [
26
- 'warn',
27
- 'always',
28
- {
29
- block: { balanced: true },
30
- markers: ['/'],
31
- },
32
- ],
33
- strict: ['warn', 'never'],
34
- 'simple-import-sort/imports': 'warn',
35
- 'simple-import-sort/exports': 'warn',
1
+ import eslint from '@eslint/js';
2
+ import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
3
+ import reactPluginConfigRecommended from 'eslint-plugin-react/configs/recommended.js';
4
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
5
+ import globals from 'globals';
6
+ import typescriptEslint from 'typescript-eslint';
7
+
8
+ export const base = [
9
+ eslint.configs.recommended,
10
+ {
11
+ linterOptions: {
12
+ reportUnusedDisableDirectives: true,
13
+ },
14
+ plugins: {
15
+ 'simple-import-sort': simpleImportSortPlugin,
16
+ },
17
+ rules: {
18
+ 'dot-notation': 'warn',
19
+ eqeqeq: ['warn', 'smart'],
20
+ 'func-names': ['warn', 'as-needed'],
21
+ 'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
22
+ 'no-alert': 'warn',
23
+ 'no-console': 'warn',
24
+ 'no-shadow': 'warn',
25
+ 'no-throw-literal': 'warn',
26
+ 'no-unused-vars': ['warn', { ignoreRestSiblings: true }],
27
+ 'no-useless-computed-key': 'warn',
28
+ 'no-useless-concat': 'warn',
29
+ 'no-useless-rename': 'warn',
30
+ 'object-shorthand': 'warn',
31
+ 'operator-assignment': 'warn',
32
+ 'prefer-const': ['warn', { destructuring: 'all' }],
33
+ 'prefer-template': 'warn',
34
+ radix: 'warn',
35
+ 'spaced-comment': [
36
+ 'warn',
37
+ 'always',
38
+ {
39
+ block: { balanced: true },
40
+ markers: ['/'],
41
+ },
42
+ ],
43
+ strict: ['warn', 'never'],
44
+ 'simple-import-sort/imports': 'warn',
45
+ 'simple-import-sort/exports': 'warn',
46
+ },
36
47
  },
37
- };
48
+ ];
49
+
50
+ export const browser = [
51
+ {
52
+ languageOptions: {
53
+ globals: globals.browser,
54
+ },
55
+ },
56
+ ];
57
+
58
+ export const node = [
59
+ {
60
+ languageOptions: {
61
+ globals: globals.nodeBuiltin,
62
+ },
63
+ },
64
+ ];
65
+
66
+ export const react = [
67
+ reactPluginConfigRecommended,
68
+ {
69
+ languageOptions: {
70
+ globals: globals['shared-node-browser'],
71
+ },
72
+ plugins: {
73
+ 'react-hooks': reactHooksPlugin,
74
+ },
75
+ settings: { react: { version: 'detect' } },
76
+ rules: {
77
+ 'react/display-name': 'off',
78
+ 'react/jsx-boolean-value': 'warn',
79
+ 'react/jsx-curly-brace-presence': 'warn',
80
+ 'react/jsx-fragments': 'warn',
81
+ 'react/jsx-key': [
82
+ 'warn',
83
+ { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true },
84
+ ],
85
+ 'react/jsx-no-target-blank': [
86
+ 'error',
87
+ { allowReferrer: true, warnOnSpreadAttributes: true },
88
+ ],
89
+ 'react/jsx-uses-react': 'off',
90
+ 'react/no-danger': 'warn',
91
+ 'react/no-unused-prop-types': 'warn',
92
+ 'react/prop-types': 'off',
93
+ 'react/react-in-jsx-scope': 'off',
94
+ 'react/require-render-return': 'off',
95
+ 'react-hooks/rules-of-hooks': 'error',
96
+ 'react-hooks/exhaustive-deps': 'warn',
97
+ },
98
+ },
99
+ ];
100
+
101
+ export const typescript = [
102
+ ...typescriptEslint.configs.recommended,
103
+ {
104
+ rules: {
105
+ '@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
106
+ '@typescript-eslint/ban-ts-comment': [
107
+ 'warn',
108
+ { 'ts-ignore': 'allow-with-description' },
109
+ ],
110
+ '@typescript-eslint/consistent-type-imports': 'warn',
111
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
112
+ '@typescript-eslint/no-non-null-assertion': 'warn',
113
+ '@typescript-eslint/no-shadow': 'warn',
114
+ '@typescript-eslint/no-unused-vars': [
115
+ 'warn',
116
+ { ignoreRestSiblings: true },
117
+ ],
118
+ 'no-shadow': 'off',
119
+ },
120
+ },
121
+ ];
package/package.json CHANGED
@@ -1,35 +1,37 @@
1
1
  {
2
+ "type": "module",
2
3
  "name": "@faergeek/eslint-config",
3
- "version": "6.0.17",
4
+ "version": "7.0.0-beta.1",
4
5
  "main": "index.js",
5
6
  "repository": "git@github.com:faergeek/eslint-config.git",
6
7
  "author": "Sergey Slipchenko <faergeek@gmail.com>",
7
8
  "license": "MIT",
9
+ "exports": {
10
+ ".": "./index.js"
11
+ },
8
12
  "files": [
9
13
  "*.js"
10
14
  ],
11
15
  "scripts": {
12
- "lint": "eslint --max-warnings 0 .",
13
- "lint:check-prettier-conflicts": "eslint-config-prettier test.js",
16
+ "lint": "eslint --max-warnings 0",
14
17
  "format": "prettier --write .",
15
18
  "format:check": "prettier --check ."
16
19
  },
17
20
  "peerDependencies": {
18
- "eslint": "^8.56.0"
21
+ "eslint": "^9.0.0"
19
22
  },
20
- "packageManager": "pnpm@9.0.6",
23
+ "packageManager": "pnpm@9.1.0",
21
24
  "dependencies": {
22
- "@typescript-eslint/eslint-plugin": "^7.0.1",
23
- "@typescript-eslint/parser": "^7.0.1",
24
- "eslint-config-prettier": "^9.0.0",
25
25
  "eslint-plugin-react": "^7.23.2",
26
26
  "eslint-plugin-react-hooks": "^4.2.0",
27
- "eslint-plugin-simple-import-sort": "^12.0.0"
27
+ "eslint-plugin-simple-import-sort": "^12.0.0",
28
+ "globals": "^15.0.0",
29
+ "typescript-eslint": "^7.5.0"
28
30
  },
29
31
  "devDependencies": {
30
32
  "@commitlint/cli": "^19.0.0",
31
33
  "@commitlint/config-conventional": "^19.0.0",
32
- "eslint": "^8.0.0",
34
+ "eslint": "^9.0.0",
33
35
  "prettier": "^3.0.0",
34
36
  "semantic-release": "^23.0.0"
35
37
  }
package/node.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- env: {
3
- node: true,
4
- },
5
- };
package/react.js DELETED
@@ -1,25 +0,0 @@
1
- module.exports = {
2
- extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
3
- env: { 'shared-node-browser': true },
4
- settings: { react: { version: 'detect' } },
5
- rules: {
6
- 'react/display-name': 'off',
7
- 'react/jsx-boolean-value': 'warn',
8
- 'react/jsx-curly-brace-presence': 'warn',
9
- 'react/jsx-fragments': 'warn',
10
- 'react/jsx-key': [
11
- 'warn',
12
- { checkFragmentShorthand: true, checkKeyMustBeforeSpread: true },
13
- ],
14
- 'react/jsx-no-target-blank': [
15
- 'error',
16
- { allowReferrer: true, warnOnSpreadAttributes: true },
17
- ],
18
- 'react/jsx-uses-react': 'off',
19
- 'react/no-danger': 'warn',
20
- 'react/no-unused-prop-types': 'warn',
21
- 'react/prop-types': 'off',
22
- 'react/react-in-jsx-scope': 'off',
23
- 'react/require-render-return': 'off',
24
- },
25
- };
package/typescript.js DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
3
- rules: {
4
- '@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
5
- '@typescript-eslint/ban-ts-comment': [
6
- 'warn',
7
- { 'ts-ignore': 'allow-with-description' },
8
- ],
9
- '@typescript-eslint/consistent-type-imports': 'warn',
10
- '@typescript-eslint/explicit-module-boundary-types': 'off',
11
- '@typescript-eslint/no-non-null-assertion': 'warn',
12
- '@typescript-eslint/no-shadow': 'warn',
13
- '@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
14
- 'no-shadow': 'off',
15
- },
16
- };