@mikey-pro/eslint-config 8.0.16 → 8.0.17

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.
Files changed (3) hide show
  1. package/index.js +12 -2
  2. package/package.json +1 -1
  3. package/rules.js +7 -8
package/index.js CHANGED
@@ -14,7 +14,7 @@ import importSortPlugin from 'eslint-plugin-simple-import-sort';
14
14
  import perfectionistPlugin from 'eslint-plugin-perfectionist';
15
15
  import noSecretsPlugin from 'eslint-plugin-no-secrets';
16
16
  import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
17
- // Remove jest plugin import since it's now in overrides.js
17
+ import sonarjsPlugin from 'eslint-plugin-sonarjs';
18
18
 
19
19
  import { baseOverrides } from './overrides.js';
20
20
  import { baseRules } from './rules.js';
@@ -82,7 +82,7 @@ const config = [
82
82
  perfectionist: perfectionistPlugin,
83
83
  'no-secrets': noSecretsPlugin,
84
84
  'no-only-tests': noOnlyTestsPlugin,
85
- // Remove jest plugin from here since it's in overrides
85
+ sonarjs: sonarjsPlugin,
86
86
  },
87
87
  rules: {
88
88
  ...baseRules,
@@ -90,6 +90,7 @@ const config = [
90
90
  ...compatPlugin.configs.recommended.rules,
91
91
  ...cssModules.configs.recommended.rules,
92
92
  ...importPlugin.configs.recommended.rules,
93
+ ...sonarjsPlugin.configs.recommended.rules,
93
94
  'prettier/prettier': ['warn', {
94
95
  parser: 'babel',
95
96
  endOfLine: 'lf',
@@ -127,6 +128,15 @@ const config = [
127
128
  'import/no-cycle': 'warn',
128
129
  'import/no-useless-path-segments': 'warn',
129
130
  'import/no-anonymous-default-export': 'warn',
131
+
132
+ // SonarJS rules
133
+ 'sonarjs/cognitive-complexity': ['error', 15],
134
+ 'sonarjs/no-duplicate-string': ['error', 5],
135
+ 'sonarjs/no-redundant-boolean': 'error',
136
+ 'sonarjs/prefer-immediate-return': 'error',
137
+ 'sonarjs/no-small-switch': 'warn',
138
+ 'sonarjs/no-duplicated-branches': 'error',
139
+ 'sonarjs/max-switch-cases': ['warn', 10],
130
140
  },
131
141
  settings: {
132
142
  'json/json-with-comments-files': [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikey-pro/eslint-config",
3
- "version": "8.0.16",
3
+ "version": "8.0.17",
4
4
  "description": "Mikey Pro ESLint configuration",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/rules.js CHANGED
@@ -210,11 +210,13 @@ export const baseRules = {
210
210
  'security/detect-non-literal-regexp': 'error',
211
211
  'security/detect-non-literal-require': 'error',
212
212
 
213
- // Code Quality
214
- 'sonarjs/cognitive-complexity': ['error', 15],
215
- 'sonarjs/no-duplicate-string': ['error', 5],
216
- 'sonarjs/no-redundant-boolean': 'error',
217
- 'sonarjs/prefer-immediate-return': 'error',
213
+ 'no-duplicate-imports': 'error',
214
+ 'no-unreachable': 'error',
215
+ 'no-constant-condition': 'error',
216
+ 'complexity': ['error', { max: 15 }],
217
+
218
+ // RegExp
219
+ 'regexp/no-missing-g-flag': 'error',
218
220
 
219
221
  // Enhanced TypeScript
220
222
  'etc/no-commented-out-code': 'warn',
@@ -240,9 +242,6 @@ export const baseRules = {
240
242
 
241
243
  // Code Quality
242
244
  'write-good-comments/write-good-comments': 'warn',
243
- 'sonarjs/no-small-switch': 'warn',
244
- 'sonarjs/no-duplicated-branches': 'error',
245
- 'sonarjs/max-switch-cases': ['warn', 10],
246
245
 
247
246
  // Import Safety
248
247
  'import/no-cycle': ['error', {