@cutting/eslint-config 4.46.0 → 5.1.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/index.mjs +111 -0
- package/package.json +26 -23
- package/react.mjs +56 -0
- package/angular.cjs +0 -3
- package/index.cjs +0 -71
- package/node.cjs +0 -3
- package/react.cjs +0 -39
package/index.mjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { fixupPluginRules } from '@eslint/compat';
|
|
5
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
6
|
+
import js from '@eslint/js';
|
|
7
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
8
|
+
import tsParser from '@typescript-eslint/parser';
|
|
9
|
+
import _import from 'eslint-plugin-import';
|
|
10
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default [
|
|
21
|
+
{ ignores: ['**/node_modules/**', '**/dist/**', '**/**.d.ts'] },
|
|
22
|
+
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
|
|
23
|
+
{
|
|
24
|
+
plugins: {
|
|
25
|
+
'@typescript-eslint': typescriptEslint,
|
|
26
|
+
'simple-import-sort': simpleImportSort,
|
|
27
|
+
import: fixupPluginRules(_import),
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
languageOptions: {
|
|
31
|
+
globals: {
|
|
32
|
+
MyGlobal: true,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
parser: tsParser,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
rules: {
|
|
39
|
+
'@typescript-eslint/no-parameter-properties': ['off'],
|
|
40
|
+
'@typescript-eslint/no-namespace': ['off'],
|
|
41
|
+
|
|
42
|
+
'@typescript-eslint/explicit-module-boundary-types': [
|
|
43
|
+
'error',
|
|
44
|
+
{
|
|
45
|
+
allowArgumentsExplicitlyTypedAsAny: true,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
50
|
+
'no-var': 'warn',
|
|
51
|
+
|
|
52
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
53
|
+
|
|
54
|
+
curly: 'error',
|
|
55
|
+
eqeqeq: ['error', 'always'],
|
|
56
|
+
'prefer-const': 'warn',
|
|
57
|
+
|
|
58
|
+
'prettier/prettier': [
|
|
59
|
+
'error',
|
|
60
|
+
{
|
|
61
|
+
printWidth: 120,
|
|
62
|
+
singleQuote: true,
|
|
63
|
+
semi: true,
|
|
64
|
+
tabWidth: 2,
|
|
65
|
+
trailingComma: 'all',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
|
|
69
|
+
semi: ['error', 'always'],
|
|
70
|
+
'no-unused-vars': 'off',
|
|
71
|
+
|
|
72
|
+
'@typescript-eslint/no-unused-vars': [
|
|
73
|
+
'error',
|
|
74
|
+
{
|
|
75
|
+
argsIgnorePattern: '^_',
|
|
76
|
+
varsIgnorePattern: '^_',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
|
|
80
|
+
'simple-import-sort/imports': 'error',
|
|
81
|
+
'simple-import-sort/exports': 'error',
|
|
82
|
+
'import/first': 'error',
|
|
83
|
+
'import/newline-after-import': 'error',
|
|
84
|
+
'import/no-duplicates': 'error',
|
|
85
|
+
'import/no-unresolved': 'off',
|
|
86
|
+
'import/consistent-type-specifier-style': 'off',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
files: ['**/*.js'],
|
|
91
|
+
|
|
92
|
+
rules: {
|
|
93
|
+
'prettier/prettier': [
|
|
94
|
+
'error',
|
|
95
|
+
{
|
|
96
|
+
printWidth: 140,
|
|
97
|
+
singleQuote: true,
|
|
98
|
+
semi: true,
|
|
99
|
+
tabWidth: 2,
|
|
100
|
+
trailingComma: 'none',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
|
|
104
|
+
semi: ['error', 'always'],
|
|
105
|
+
'@typescript-eslint/no-use-before-define': ['off'],
|
|
106
|
+
'@typescript-eslint/camelcase': ['off'],
|
|
107
|
+
'@typescript-eslint/no-var-requires': ['off'],
|
|
108
|
+
'no-var': ['off'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutting/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Cutting eslint configuration definition",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "index.mjs",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"files": [
|
|
8
|
-
"index.
|
|
9
|
-
"react.
|
|
10
|
-
"angular.cjs",
|
|
11
|
-
"node.cjs",
|
|
9
|
+
"index.mjs",
|
|
10
|
+
"react.mjs",
|
|
12
11
|
"README.md",
|
|
13
12
|
"partial.html"
|
|
14
13
|
],
|
|
@@ -21,28 +20,32 @@
|
|
|
21
20
|
"react"
|
|
22
21
|
],
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "
|
|
25
|
-
"@typescript-eslint/parser": "
|
|
26
|
-
"eslint": "
|
|
27
|
-
"eslint-config-prettier": "
|
|
28
|
-
"eslint-plugin-import": "^2.
|
|
29
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
30
|
-
"eslint-plugin-prettier": "5.
|
|
31
|
-
"eslint-plugin-react": "7.
|
|
32
|
-
"eslint-plugin-react-hooks": "
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "8.26.0",
|
|
24
|
+
"@typescript-eslint/parser": "8.26.0",
|
|
25
|
+
"eslint": "9.21.0",
|
|
26
|
+
"eslint-config-prettier": "10.0.2",
|
|
27
|
+
"eslint-plugin-import": "^2.31.0",
|
|
28
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
29
|
+
"eslint-plugin-prettier": "5.2.3",
|
|
30
|
+
"eslint-plugin-react": "7.37.4",
|
|
31
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
33
32
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
34
|
-
"prettier": "3.3
|
|
33
|
+
"prettier": "3.5.3"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|
|
37
|
-
"@typescript-eslint/eslint-plugin": ">=
|
|
38
|
-
"@typescript-eslint/parser": "=
|
|
39
|
-
"eslint": ">=
|
|
36
|
+
"@typescript-eslint/eslint-plugin": ">= 8.26.0",
|
|
37
|
+
"@typescript-eslint/parser": "= 8.26.0",
|
|
38
|
+
"eslint": ">= 9.9.x",
|
|
40
39
|
"eslint-config-prettier": ">= 9.1.x",
|
|
41
|
-
"eslint-plugin-jsx-a11y": ">= 6.
|
|
42
|
-
"eslint-plugin-prettier": ">= 5.
|
|
40
|
+
"eslint-plugin-jsx-a11y": ">= 6.9.x",
|
|
41
|
+
"eslint-plugin-prettier": ">= 5.2.3",
|
|
43
42
|
"eslint-plugin-react": ">= 7.34.2",
|
|
44
|
-
"eslint-plugin-react-hooks": ">= 4.6.
|
|
45
|
-
"prettier": ">= 3.3
|
|
43
|
+
"eslint-plugin-react-hooks": ">= 4.6.2",
|
|
44
|
+
"prettier": ">= 3.5.3"
|
|
45
|
+
},
|
|
46
|
+
"exports": {
|
|
47
|
+
"./eslint": "./index.mjs",
|
|
48
|
+
"./react": "./react.mjs"
|
|
46
49
|
},
|
|
47
50
|
"volta": {
|
|
48
51
|
"extends": "../../package.json"
|
package/react.mjs
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import react from "eslint-plugin-react";
|
|
2
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
3
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import js from "@eslint/js";
|
|
7
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
8
|
+
import defaultConfig from './index.mjs'
|
|
9
|
+
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
const compat = new FlatCompat({
|
|
13
|
+
baseDirectory: __dirname,
|
|
14
|
+
recommendedConfig: js.configs.recommended,
|
|
15
|
+
allConfig: js.configs.all
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default [
|
|
19
|
+
...compat.extends("plugin:react/recommended", "plugin:jsx-a11y/recommended"),
|
|
20
|
+
...defaultConfig,
|
|
21
|
+
{
|
|
22
|
+
plugins: {
|
|
23
|
+
react,
|
|
24
|
+
"react-hooks": fixupPluginRules(reactHooks),
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
languageOptions: {
|
|
28
|
+
ecmaVersion: 5,
|
|
29
|
+
sourceType: "script",
|
|
30
|
+
|
|
31
|
+
parserOptions: {
|
|
32
|
+
ecmaFeatures: {
|
|
33
|
+
jsx: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
settings: {
|
|
39
|
+
react: {
|
|
40
|
+
pragma: "React",
|
|
41
|
+
version: "detect",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
rules: {
|
|
46
|
+
"react-hooks/rules-of-hooks": ["error"],
|
|
47
|
+
|
|
48
|
+
"react-hooks/exhaustive-deps": ["error", {
|
|
49
|
+
additionalHooks: "(useIsomorphicLayoutEffect)",
|
|
50
|
+
}],
|
|
51
|
+
|
|
52
|
+
"react/prop-types": 0,
|
|
53
|
+
"react/react-in-jsx-scope": 0,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
package/angular.cjs
DELETED
package/index.cjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
globals: {
|
|
3
|
-
MyGlobal: true,
|
|
4
|
-
},
|
|
5
|
-
parser: '@typescript-eslint/parser',
|
|
6
|
-
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
|
7
|
-
plugins: ['@typescript-eslint', 'simple-import-sort', 'import'],
|
|
8
|
-
rules: {
|
|
9
|
-
'@typescript-eslint/no-parameter-properties': ['off'],
|
|
10
|
-
'@typescript-eslint/no-namespace': ['off'],
|
|
11
|
-
'@typescript-eslint/explicit-module-boundary-types': ['error', { allowArgumentsExplicitlyTypedAsAny: true }],
|
|
12
|
-
'@typescript-eslint/consistent-type-imports': 'error',
|
|
13
|
-
'no-var': 'warn',
|
|
14
|
-
'@typescript-eslint/ban-types': [
|
|
15
|
-
'error',
|
|
16
|
-
{
|
|
17
|
-
types: {
|
|
18
|
-
'{}': {
|
|
19
|
-
message: 'Use Record<string, unknown> instead',
|
|
20
|
-
fixWith: 'Record<string, unknown>',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
curly: 'error',
|
|
26
|
-
eqeqeq: ['error', 'always'],
|
|
27
|
-
'prefer-const': 'warn',
|
|
28
|
-
'prettier/prettier': [
|
|
29
|
-
'error',
|
|
30
|
-
{
|
|
31
|
-
printWidth: 120,
|
|
32
|
-
singleQuote: true,
|
|
33
|
-
semi: true,
|
|
34
|
-
tabWidth: 2,
|
|
35
|
-
trailingComma: 'all',
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
semi: ['error', 'always'],
|
|
39
|
-
'no-unused-vars': 'off',
|
|
40
|
-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
41
|
-
'simple-import-sort/imports': 'error',
|
|
42
|
-
'simple-import-sort/exports': 'error',
|
|
43
|
-
'import/first': 'error',
|
|
44
|
-
'import/newline-after-import': 'error',
|
|
45
|
-
'import/no-duplicates': 'error',
|
|
46
|
-
'import/no-unresolved': 'off',
|
|
47
|
-
'import/consistent-type-specifier-style': 'off',
|
|
48
|
-
},
|
|
49
|
-
overrides: [
|
|
50
|
-
{
|
|
51
|
-
files: ['**/*.js'],
|
|
52
|
-
rules: {
|
|
53
|
-
'prettier/prettier': [
|
|
54
|
-
'error',
|
|
55
|
-
{
|
|
56
|
-
printWidth: 140,
|
|
57
|
-
singleQuote: true,
|
|
58
|
-
semi: true,
|
|
59
|
-
tabWidth: 2,
|
|
60
|
-
trailingComma: 'none',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
semi: ['error', 'always'],
|
|
64
|
-
'@typescript-eslint/no-use-before-define': ['off'],
|
|
65
|
-
'@typescript-eslint/camelcase': ['off'],
|
|
66
|
-
'@typescript-eslint/no-var-requires': ['off'],
|
|
67
|
-
'no-var': ['off'],
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
};
|
package/node.cjs
DELETED
package/react.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: './index.cjs',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
ecmaVersion: 2018,
|
|
5
|
-
sourceType: 'module',
|
|
6
|
-
ecmaFeatures: {
|
|
7
|
-
jsx: true,
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
extends: ['./index.cjs', 'plugin:react/recommended', 'plugin:jsx-a11y/recommended'],
|
|
11
|
-
settings: {
|
|
12
|
-
react: {
|
|
13
|
-
pragma: 'React',
|
|
14
|
-
version: 'detect',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
parserOptions: {
|
|
18
|
-
ecmaFeatures: {
|
|
19
|
-
jsx: true,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
plugins: ['react', 'react-hooks'],
|
|
23
|
-
rules: {
|
|
24
|
-
'react-hooks/rules-of-hooks': [
|
|
25
|
-
'error',
|
|
26
|
-
{
|
|
27
|
-
additionalHooks: '(useIsomorphicLayoutEffect)',
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
'react-hooks/exhaustive-deps': [
|
|
31
|
-
'error',
|
|
32
|
-
{
|
|
33
|
-
additionalHooks: '(useIsomorphicLayoutEffect)',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
'react/prop-types': 0,
|
|
37
|
-
'react/react-in-jsx-scope': 0,
|
|
38
|
-
},
|
|
39
|
-
};
|