@etchteam/eslint-config 3.1.7 → 3.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,10 @@
1
- ## <small>3.1.7 (2026-04-16)</small>
1
+ ## 3.2.0 (2026-04-20)
2
2
 
3
- * Merge pull request #563 from etchteam/dependabot/npm_and_yarn/npm_and_yarn-da47bb892b ([ef34c14](https://github.com/etchteam/eslint/commit/ef34c14)), closes [#563](https://github.com/etchteam/eslint/issues/563)
4
- * Merge pull request #564 from etchteam/fix/webc-browser-globals ([b10f47a](https://github.com/etchteam/eslint/commit/b10f47a)), closes [#564](https://github.com/etchteam/eslint/issues/564)
5
- * fix: add browser globals to webc virtual JS files ([b487521](https://github.com/etchteam/eslint/commit/b487521))
6
- * chore: Bump hono in the npm_and_yarn group across 1 directory ([1d5c097](https://github.com/etchteam/eslint/commit/1d5c097))
3
+ * Merge pull request #565 from etchteam/dependabot/npm_and_yarn/next/eslint-plugin-next-16.2.4 ([7e658c6](https://github.com/etchteam/eslint/commit/7e658c6)), closes [#565](https://github.com/etchteam/eslint/issues/565)
4
+ * Merge pull request #566 from etchteam/dependabot/npm_and_yarn/darraghor/eslint-plugin-nestjs-typed-7 ([330438f](https://github.com/etchteam/eslint/commit/330438f)), closes [#566](https://github.com/etchteam/eslint/issues/566)
5
+ * Merge pull request #567 from etchteam/dependabot/npm_and_yarn/eslint-plugin-react-hooks-7.1.0 ([5939065](https://github.com/etchteam/eslint/commit/5939065)), closes [#567](https://github.com/etchteam/eslint/issues/567)
6
+ * Merge pull request #568 from etchteam/feat/add-sonarjs-plugin ([2ebd744](https://github.com/etchteam/eslint/commit/2ebd744)), closes [#568](https://github.com/etchteam/eslint/issues/568)
7
+ * feat: add eslint-plugin-sonarjs to base config ([a111ccc](https://github.com/etchteam/eslint/commit/a111ccc))
8
+ * chore: Bump @darraghor/eslint-plugin-nestjs-typed from 7.1.29 to 7.1.30 ([2d938f5](https://github.com/etchteam/eslint/commit/2d938f5))
9
+ * chore: Bump @next/eslint-plugin-next from 16.2.3 to 16.2.4 ([eb7a485](https://github.com/etchteam/eslint/commit/eb7a485))
10
+ * chore: Bump eslint-plugin-react-hooks from 7.0.1 to 7.1.0 ([607d6c6](https://github.com/etchteam/eslint/commit/607d6c6))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etchteam/eslint-config",
3
- "version": "3.1.7",
3
+ "version": "3.2.0",
4
4
  "description": "Etch's standard eslint config",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
@@ -63,6 +63,7 @@
63
63
  "eslint-plugin-json": "^4.0.1",
64
64
  "eslint-plugin-prettier": "^5.5.0",
65
65
  "eslint-plugin-security": "^4.0.0",
66
+ "eslint-plugin-sonarjs": "^3.0.7",
66
67
  "eslint-plugin-unused-imports": "^4.1.3",
67
68
  "eslint-plugin-yml": "^3.0.0",
68
69
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
@@ -77,8 +78,8 @@
77
78
  "eslint-plugin-jsx-a11y": ">=6.0.0",
78
79
  "eslint-plugin-lit": ">=2.0.0",
79
80
  "eslint-plugin-react": ">=7.0.0",
80
- "eslint-plugin-storybook": ">=10.0.0",
81
81
  "eslint-plugin-react-hooks": ">=5.0.0",
82
+ "eslint-plugin-storybook": ">=10.0.0",
82
83
  "prettier": ">=3.0.0",
83
84
  "typescript": ">=4.8.4"
84
85
  },
package/src/base.mjs CHANGED
@@ -2,12 +2,37 @@ import js from '@eslint/js';
2
2
  import importPlugin from 'eslint-plugin-import';
3
3
  import prettier from 'eslint-plugin-prettier/recommended';
4
4
  import security from 'eslint-plugin-security';
5
+ import sonarjs from 'eslint-plugin-sonarjs';
5
6
  import unusedImports from 'eslint-plugin-unused-imports';
6
7
  import youDontNeedLodash from 'eslint-plugin-you-dont-need-lodash-underscore';
7
8
  import tseslint from 'typescript-eslint';
8
9
 
9
10
  import { fixupPluginRules } from './utils/fixup.mjs';
10
11
 
12
+ const JS_FILES = ['**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'];
13
+
14
+ /**
15
+ * Catch some common sonar issues locally, this is JS/TS only and not a 1:1 mirror
16
+ * of Sonar's web-UI Quality Profile. Everything is downgraded to 'warn' because it
17
+ * doesn't recognise when issues have been marked as safe in the Sonar web UI.
18
+ *
19
+ * Rule updates:
20
+ * - `file-header` is off because we never us a header template and it warns on every file.
21
+ * - `sonarjs/arrow-function-convention` is off because it conflicts with prettier.
22
+ */
23
+ const sonarConfig = {
24
+ ...sonarjs.configs.recommended,
25
+ files: JS_FILES,
26
+ rules: {
27
+ ...Object.fromEntries(
28
+ Object.keys(sonarjs.configs.recommended.rules).map((r) => [r, 'warn']),
29
+ ),
30
+ 'sonarjs/file-header': 'off',
31
+ 'sonarjs/arrow-function-convention': 'off',
32
+ 'sonarjs/declarations-in-global-scope': 'off',
33
+ },
34
+ };
35
+
11
36
  /**
12
37
  * Base ESLint configuration for all projects.
13
38
  * Includes: JavaScript, TypeScript, security, import ordering, prettier, and common rules.
@@ -17,8 +42,9 @@ export default [
17
42
  js.configs.recommended,
18
43
  ...tseslint.configs.recommended,
19
44
  security.configs.recommended,
45
+ sonarConfig,
20
46
  {
21
- files: ['**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'],
47
+ files: JS_FILES,
22
48
  plugins: {
23
49
  'unused-imports': unusedImports,
24
50
  import: fixupPluginRules(importPlugin),