@niondigital/eslint-config-base 4.0.0 → 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/CHANGELOG.md +10 -0
- package/README.md +7 -0
- package/config.js +14 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0](https://github.com/niondigital/javascript-style/compare/v4.0.0...v5.0.0) (2026-07-14)
|
|
7
|
+
|
|
8
|
+
- feat(eslint-config-base)!: enforce size backstops and no-console (#7) ([e39251c](https://github.com/niondigital/javascript-style/commit/e39251c749533e59ec3b2b6af361f5352254eeaf)), closes [#7](https://github.com/niondigital/javascript-style/issues/7)
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
- consumer projects now error on files/functions over the
|
|
13
|
+
size limits and on any console call; suppress per file via additionalRules
|
|
14
|
+
or additionalConfig where console output is legitimate.
|
|
15
|
+
|
|
6
16
|
# [4.0.0](https://github.com/niondigital/javascript-style/compare/v3.1.0...v4.0.0) (2026-06-16)
|
|
7
17
|
|
|
8
18
|
- feat!: upgrade all config packages to newest versions (v4.0.0) (#4) ([31ad2f0](https://github.com/niondigital/javascript-style/commit/31ad2f0b26f1c6e57a90d14bed435abbfba091c2)), closes [#4](https://github.com/niondigital/javascript-style/issues/4)
|
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Shared ESLint config as base by [nion digital](https://www.nion-digital.com).
|
|
4
4
|
|
|
5
|
+
## Enforced rules
|
|
6
|
+
|
|
7
|
+
On top of `eslint:recommended` and `typescript-eslint` recommended, this config enforces:
|
|
8
|
+
|
|
9
|
+
- **Size backstops**: `max-lines` (400, error), `max-lines-per-function` (80), `complexity` (12). Test files (`*.{test,spec}.*`, `__tests__/`, `__mocks__/`) are exempt from all three.
|
|
10
|
+
- **No `console`**: use a logging facade instead. Override per file via `additionalRules` / `additionalConfig` for legitimate CLI tooling.
|
|
11
|
+
|
|
5
12
|
## Installation
|
|
6
13
|
|
|
7
14
|
1. Install package as a dev dependency:
|
package/config.js
CHANGED
|
@@ -13,6 +13,11 @@ export default ({ ignores = [], additionalRules = {}, additionalConfig = [] } =
|
|
|
13
13
|
'no-useless-assignment': 'off', // newly added to v10 recommended
|
|
14
14
|
'preserve-caught-error': 'off', // newly added to v10 recommended
|
|
15
15
|
'no-shadow-restricted-names': ['error', { reportGlobalThis: false }], // v10 flipped reportGlobalThis default to true
|
|
16
|
+
// Size backstops against god-files and sprawling functions.
|
|
17
|
+
'max-lines': ['error', { max: 400, skipBlankLines: true, skipComments: true }],
|
|
18
|
+
'max-lines-per-function': ['error', { max: 80, skipBlankLines: true, skipComments: true }],
|
|
19
|
+
complexity: ['error', { max: 12 }],
|
|
20
|
+
'no-console': 'error', // use a logging facade, not console
|
|
16
21
|
...additionalRules,
|
|
17
22
|
};
|
|
18
23
|
|
|
@@ -22,5 +27,14 @@ export default ({ ignores = [], additionalRules = {}, additionalConfig = [] } =
|
|
|
22
27
|
...additionalConfig,
|
|
23
28
|
{ ignores },
|
|
24
29
|
{ rules },
|
|
30
|
+
// Tests are exempt from the size backstops.
|
|
31
|
+
{
|
|
32
|
+
files: ['**/*.{test,spec}.{js,jsx,ts,tsx,mjs,cjs,mts,cts}', '**/__tests__/**', '**/__mocks__/**'],
|
|
33
|
+
rules: {
|
|
34
|
+
'max-lines': 'off',
|
|
35
|
+
'max-lines-per-function': 'off',
|
|
36
|
+
complexity: 'off',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
25
39
|
]);
|
|
26
40
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niondigital/eslint-config-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"author": "Dominik Gallitzendörfer <dominik.gallitzendoerfer@nion-digital.com>",
|
|
6
6
|
"main": "./config.js",
|
|
7
7
|
"repository": "https://github.com/niondigital/javascript-style",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"typescript": "^6.0.3",
|
|
17
17
|
"typescript-eslint": "^8.61.1"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "0b2cf8519a4fd029222f5d70cb1f94523e1d34de"
|
|
20
20
|
}
|