@cutting/eslint-config 4.45.10 → 5.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/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": "4.45.10",
3
+ "version": "5.0.0",
4
4
  "description": "Cutting eslint configuration definition",
5
- "main": "index.cjs",
5
+ "type": "module",
6
+ "module": "index.mjs",
6
7
  "license": "MIT",
7
8
  "files": [
8
- "index.cjs",
9
- "react.cjs",
10
- "angular.cjs",
11
- "node.cjs",
9
+ "index.mjs",
10
+ "react.mjs",
12
11
  "README.md",
13
12
  "partial.html"
14
13
  ],
@@ -21,26 +20,32 @@
21
20
  "react"
22
21
  ],
23
22
  "dependencies": {
24
- "@typescript-eslint/eslint-plugin": "7.10.0",
25
- "@typescript-eslint/parser": "7.7.0",
26
- "eslint": "8.57.0",
23
+ "@typescript-eslint/eslint-plugin": "8.3.0",
24
+ "@typescript-eslint/parser": "8.3.0",
25
+ "eslint": "9.9.1",
27
26
  "eslint-config-prettier": "9.1.0",
28
- "eslint-plugin-jsx-a11y": "6.8.0",
29
- "eslint-plugin-prettier": "5.1.3",
30
- "eslint-plugin-react": "7.34.3",
27
+ "eslint-plugin-import": "^2.29.1",
28
+ "eslint-plugin-jsx-a11y": "6.9.0",
29
+ "eslint-plugin-prettier": "5.2.1",
30
+ "eslint-plugin-react": "7.35.0",
31
31
  "eslint-plugin-react-hooks": "4.6.2",
32
- "prettier": "3.3.2"
32
+ "eslint-plugin-simple-import-sort": "^12.1.1",
33
+ "prettier": "3.3.3"
33
34
  },
34
35
  "peerDependencies": {
35
- "@typescript-eslint/eslint-plugin": ">= 7.10.0",
36
- "@typescript-eslint/parser": "= 7.7.0",
37
- "eslint": ">= 8.57.x",
36
+ "@typescript-eslint/eslint-plugin": ">= 8.3.0",
37
+ "@typescript-eslint/parser": "= 8.3.0",
38
+ "eslint": ">= 9.9.x",
38
39
  "eslint-config-prettier": ">= 9.1.x",
39
- "eslint-plugin-jsx-a11y": ">= 6.8.x",
40
- "eslint-plugin-prettier": ">= 5.1.3",
40
+ "eslint-plugin-jsx-a11y": ">= 6.9.x",
41
+ "eslint-plugin-prettier": ">= 5.2.1",
41
42
  "eslint-plugin-react": ">= 7.34.2",
42
43
  "eslint-plugin-react-hooks": ">= 4.6.z",
43
- "prettier": ">= 3.3.2"
44
+ "prettier": ">= 3.3.3"
45
+ },
46
+ "exports": {
47
+ "./eslint": "./index.mjs",
48
+ "./react": "./react.mjs"
44
49
  },
45
50
  "volta": {
46
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
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: './index.cjs',
3
- };
package/index.cjs DELETED
@@ -1,64 +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'],
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
- },
42
- overrides: [
43
- {
44
- files: ['**/*.js'],
45
- rules: {
46
- 'prettier/prettier': [
47
- 'error',
48
- {
49
- printWidth: 140,
50
- singleQuote: true,
51
- semi: true,
52
- tabWidth: 2,
53
- trailingComma: 'none',
54
- },
55
- ],
56
- semi: ['error', 'always'],
57
- '@typescript-eslint/no-use-before-define': ['off'],
58
- '@typescript-eslint/camelcase': ['off'],
59
- '@typescript-eslint/no-var-requires': ['off'],
60
- 'no-var': ['off'],
61
- },
62
- },
63
- ],
64
- };
package/node.cjs DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: './index.cjs',
3
- };
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
- };