eslint-config-fabulator 5.0.0 → 5.2.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/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## v5.2.0 (2025-03-24)
5
+ ### Added
6
+ - [98ba884](https://github.com/fabulator/eslint-config-fabulator/commit/98ba88411726cc2986152b42ea2feb2c03220cc4) no-console rule
7
+
8
+ ### Changed
9
+ - [db52c4a](https://github.com/fabulator/eslint-config-fabulator/commit/db52c4a1fc4167a50a86e1a34476143cf19709ba) Update Github Flow dependency node to v22 (#185)
10
+
11
+ Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
12
+
13
+ ## v5.1.0 (2025-03-20)
14
+ ### Added
15
+ - [ed6ada0](https://github.com/fabulator/eslint-config-fabulator/commit/ed6ada0cc4173e54ff2413f341bf48beb3fe24c2) Vitest rules
16
+
4
17
  ## v5.0.0 (2025-03-20)
5
18
  ### Changed
6
19
  - [09dd656](https://github.com/fabulator/eslint-config-fabulator/commit/09dd656e7c1e57ee4c9f019bd898774f183dab05) Upgrade to eslint 9 BREAKING
package/README.md CHANGED
@@ -1,48 +1,3 @@
1
1
  # ESLint Config Fabulator
2
2
 
3
- This is default ESlint configurations for projects for Fabulator.
4
-
5
- ## Usage
6
-
7
- First install the package:
8
-
9
- ```nodemon
10
- npm install eslint-config-fabulator --save-dev
11
- ```
12
-
13
- and update you ESLint configuration:
14
-
15
- ```javascript
16
- module.exports = {
17
- extends: [
18
- 'eslint-config-fabulator',
19
- ],
20
- };
21
-
22
- ```
23
-
24
- In basic configuration following plugins are included:
25
-
26
- - **import** - We use ECMAScript 6 modules.
27
- - **jsdoc** - Predefined style for comments of methods.
28
- - **promise** - Predefined style for promises.
29
- - **compat** - To check that used features are supported by certain browsers.
30
- - **unicorn** - Various lints.
31
- - **filenames** - Lint file names.
32
- - **sonar** - various piggy code detection
33
- - **typescript**
34
- - **array-func**
35
-
36
- There are more extendable configurations for tests or different envs:
37
-
38
- ```javascript
39
- module.exports = {
40
- extends: [
41
- 'eslint-config-fabulator',
42
- 'eslint-config-fabulator/eslint-config/react',
43
- 'eslint-config-fabulator/eslint-config/jasmine',
44
- 'eslint-config-fabulator/eslint-config/jest',
45
- 'eslint-config-fabulator/eslint-config/babel-resolver',
46
- ],
47
- };
48
- ```
3
+ This is default ESlint configurations for projects for Fabulator ;)
package/index.js CHANGED
@@ -8,14 +8,63 @@ import importPlugin from 'eslint-plugin-import';
8
8
  import tseslint from 'typescript-eslint';
9
9
  import reactHooks from 'eslint-plugin-react-hooks';
10
10
  import globals from 'globals';
11
+ import jsxA11y from 'eslint-plugin-jsx-a11y';
12
+ import vitest from '@vitest/eslint-plugin';
11
13
 
14
+ // eslint-disable-next-line import/no-default-export
12
15
  export default defineConfig([
13
16
  {
14
17
  extends: [arrayFunc.configs.recommended],
15
18
  rules: { 'array-func/prefer-array-from': 0 },
16
19
  },
17
- js.configs.recommended,
18
- importPlugin.flatConfigs.recommended,
20
+ {
21
+ extends: [js.configs.recommended],
22
+ rules: { 'no-irregular-whitespace': 'off', 'no-console': 'error' },
23
+ },
24
+ {
25
+ files: ['**/*.test.ts', '**/*.test.js', '**/*.test.jsx', '**/*.test.tsx'],
26
+ plugins: {
27
+ vitest,
28
+ },
29
+ rules: {
30
+ ...vitest.configs.recommended.rules,
31
+ },
32
+ },
33
+ {
34
+ extends: [importPlugin.flatConfigs.recommended],
35
+ rules: {
36
+ 'import/no-deprecated': 'error',
37
+ 'import/no-empty-named-blocks': 'error',
38
+ 'import/no-extraneous-dependencies': [
39
+ 'error',
40
+ {
41
+ devDependencies: [
42
+ '**/*.config.js',
43
+ '**/*.config.ts',
44
+ '**/*.setup.ts',
45
+ '**/*.test.ts',
46
+ '**/*.test.tsx',
47
+ '**/lang/**/*.*',
48
+ ],
49
+ },
50
+ ],
51
+ 'import/no-mutable-exports': 'error',
52
+ 'import/no-unused-modules': 'error',
53
+ 'import/no-cycle': 'error',
54
+ 'import/no-relative-packages': 'error',
55
+ 'import/no-self-import': 'error',
56
+ 'import/order': ['error', { 'newlines-between': 'never' }],
57
+ 'import/no-default-export': 'error',
58
+ 'import/newline-after-import': 'error',
59
+ 'import/first': 'error',
60
+ },
61
+ },
62
+ {
63
+ files: ['**/*.config.*s'],
64
+ rules: {
65
+ 'import/no-default-export': 'off',
66
+ },
67
+ },
19
68
  {
20
69
  plugins: {
21
70
  canonical: canonical,
@@ -23,37 +72,55 @@ export default defineConfig([
23
72
  },
24
73
  {
25
74
  extends: [reactHooks.configs['recommended-latest']],
26
- files: ['use*.*sx', 'use*.js', 'use*.ts', '*.tsx', '*.jsx'],
75
+ files: ['**/use*.*sx', '**/use*.js', '**/use*.ts', '**/*.tsx', '**/*.jsx'],
27
76
  rules: {
28
77
  'react-hooks/exhaustive-deps': 'error',
29
78
  'react-hooks/rules-of-hooks': 'error',
30
79
  },
31
80
  },
32
81
  {
33
- extends: [reactPlugin.configs.recommended],
34
- files: ['*.tsx', '*.jsx'],
82
+ extends: [
83
+ reactPlugin.configs.flat.recommended,
84
+ jsxA11y.flatConfigs.recommended,
85
+ ],
86
+ files: ['**/*.tsx', '**/*.jsx'],
87
+ rules: {
88
+ 'react/react-in-jsx-scope': 'off',
89
+ 'react/display-name': 'off',
90
+ },
91
+ settings: {
92
+ react: {
93
+ version: 'detect',
94
+ },
95
+ },
35
96
  },
36
97
  {
37
98
  extends: [
38
99
  tseslint.configs.strictTypeChecked,
39
100
  tseslint.configs.stylisticTypeChecked,
40
101
  ],
41
- files: ['*.tsx', '*.ts'],
102
+ files: ['**/*.tsx', '**/*.ts'],
42
103
  rules: {
43
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
44
- '@typescript-eslint/no-non-null-assertion': 'off',
45
- '@typescript-eslint/no-empty-function': 'off',
46
- '@typescript-eslint/no-unused-vars': [
104
+ '@typescript-eslint/consistent-type-definitions': 'off',
105
+ '@typescript-eslint/restrict-template-expressions': [
47
106
  'error',
48
107
  {
49
- args: 'all',
50
- argsIgnorePattern: '^_',
51
- ignoreRestSiblings: true,
52
- vars: 'all',
108
+ allowAny: false,
109
+ allowBoolean: false,
110
+ allowNullish: false,
111
+ allowNumber: true,
112
+ allowRegExp: false,
113
+ allowNever: false,
53
114
  },
54
115
  ],
116
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
117
+ '@typescript-eslint/no-non-null-assertion': 'off',
118
+ '@typescript-eslint/no-empty-function': 'off',
119
+ '@typescript-eslint/no-unused-vars': 'off',
120
+ '@typescript-eslint/no-empty-object-type': 'off',
55
121
  '@typescript-eslint/non-nullable-type-assertion-style': 'error',
56
122
  '@typescript-eslint/prefer-optional-chain': 'error',
123
+ '@typescript-eslint/prefer-nullish-coalescing': 0,
57
124
  },
58
125
  },
59
126
  {
@@ -61,6 +128,10 @@ export default defineConfig([
61
128
  globals: { ...globals.browser, ...globals.node },
62
129
  parserOptions: { ecmaVersion: 'latest' },
63
130
  },
131
+ linterOptions: {
132
+ reportUnusedInlineConfigs: 'error',
133
+ reportUnusedDisableDirectives: 'error',
134
+ },
64
135
  settings: {
65
136
  'import/resolver': {
66
137
  // You will also need to install and configure the TypeScript resolver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-fabulator",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "description": "Shared ESLint config for fabulator projects",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -25,7 +25,8 @@
25
25
  "release": "semantic-release"
26
26
  },
27
27
  "dependencies": {
28
- "eslint": "^9.22.0",
28
+ "@eslint/js": "^9.22.0",
29
+ "@vitest/eslint-plugin": "^1.1.38",
29
30
  "eslint-config-prettier": "^10.1.1",
30
31
  "eslint-plugin-array-func": "5.0.2",
31
32
  "eslint-plugin-canonical": "^5.1.3",
@@ -40,10 +41,12 @@
40
41
  },
41
42
  "devDependencies": {
42
43
  "commitlint-config-fabulator": "^6.1.0",
44
+ "eslint": "^9.23.0",
43
45
  "semantic-release-config-fabulator": "^7.0.0",
44
46
  "typescript": "^5.8.2"
45
47
  },
46
48
  "peerDependencies": {
47
- "typescript": "^5"
49
+ "typescript": "^5",
50
+ "eslint": "^9"
48
51
  }
49
52
  }