@niondigital/eslint-config-base 3.1.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 +63 -0
- package/README.md +7 -0
- package/config.js +22 -0
- package/package.json +6 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
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
|
+
|
|
16
|
+
# [4.0.0](https://github.com/niondigital/javascript-style/compare/v3.1.0...v4.0.0) (2026-06-16)
|
|
17
|
+
|
|
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)
|
|
19
|
+
|
|
20
|
+
### BREAKING CHANGES
|
|
21
|
+
|
|
22
|
+
- consumers must use ESLint 10 and TypeScript 6.
|
|
23
|
+
|
|
24
|
+
- feat!: require stylelint 17 + cssnano 8; freeze CSS property order
|
|
25
|
+
|
|
26
|
+
Bump stylelint-config to stylelint 17, stylelint-config-standard 40 and
|
|
27
|
+
stylelint-config-clean-order 10 (adds stylelint-order 8 as a peer), and
|
|
28
|
+
postcss-config to cssnano 8 and @csstools/postcss-global-data 4.
|
|
29
|
+
|
|
30
|
+
Behavior preserved: stylelint-config-standard 40 changes no rules. clean-order 10
|
|
31
|
+
reordered/extended its propertyGroups, which would change order/properties-order,
|
|
32
|
+
so the v3.x property order is now owned in stylelint-config/property-order.js and
|
|
33
|
+
no longer tracks clean-order. The resolved stylelint ruleset is identical to v16.
|
|
34
|
+
|
|
35
|
+
Note (not a lint rule): cssnano 8 no longer alphabetically sorts declarations, so
|
|
36
|
+
minified output preserves source order. CSS rendering is unchanged.
|
|
37
|
+
|
|
38
|
+
- consumers must use stylelint 17 and cssnano 8.
|
|
39
|
+
|
|
40
|
+
- build: upgrade repo tooling (lerna 9, lint-staged 17, commitlint 21)
|
|
41
|
+
|
|
42
|
+
- chore: set internal workspace peer ranges to ^4.0.0
|
|
43
|
+
|
|
44
|
+
- build: raise Node floor to 24.11, bump postcss-preset-env, extend harness
|
|
45
|
+
|
|
46
|
+
Addresses the final review:
|
|
47
|
+
|
|
48
|
+
- Raise root engines.node to >=24.11.0 (cssnano 8's engine floor; >=24.0.0 was
|
|
49
|
+
inaccurate). .nvmrc already resolves to a satisfying Node 24.x.
|
|
50
|
+
- Bump postcss-preset-env peer/dev floor ^11.1.2 -> ^11.3.1 (latest; it was the
|
|
51
|
+
only dependency left below its newest patch).
|
|
52
|
+
- Harden validate:check to also fail on untracked snapshot files.
|
|
53
|
+
- Add ESLint lint-output snapshots (rule firing on a violations fixture) and a
|
|
54
|
+
@niondigital/commitlint-config resolved-rules snapshot, closing harness gaps.
|
|
55
|
+
|
|
56
|
+
* feat(stylelint-config): adopt clean-order 10 property order
|
|
57
|
+
|
|
58
|
+
Supersedes the interim freeze: per decision, use stylelint-config-clean-order@10's
|
|
59
|
+
updated propertyGroups for order/properties-order (443 -> 468 properties) instead
|
|
60
|
+
of the frozen v3.x list. CSS property ordering changes accordingly; no other
|
|
61
|
+
stylelint rule changes (verified: only order/properties-order differs).
|
|
62
|
+
|
|
63
|
+
- feat(setup): add root ESLint flat config so the repo lints its own source
|
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
|
@@ -5,6 +5,19 @@ import tseslint from 'typescript-eslint';
|
|
|
5
5
|
export default ({ ignores = [], additionalRules = {}, additionalConfig = [] } = {}) => {
|
|
6
6
|
const rules = {
|
|
7
7
|
'no-undef': 'off',
|
|
8
|
+
// ESLint 10 / @eslint/js 10 behavior preservation: keep the ESLint 9 effective
|
|
9
|
+
// ruleset. v10's `recommended` set added three rules and flipped one default;
|
|
10
|
+
// neutralize them so upgrading does not change which rules are enforced.
|
|
11
|
+
// Consumers can still opt in to the new rules via `additionalRules`.
|
|
12
|
+
'no-unassigned-vars': 'off', // newly added to v10 recommended
|
|
13
|
+
'no-useless-assignment': 'off', // newly added to v10 recommended
|
|
14
|
+
'preserve-caught-error': 'off', // newly added to v10 recommended
|
|
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
|
|
8
21
|
...additionalRules,
|
|
9
22
|
};
|
|
10
23
|
|
|
@@ -14,5 +27,14 @@ export default ({ ignores = [], additionalRules = {}, additionalConfig = [] } =
|
|
|
14
27
|
...additionalConfig,
|
|
15
28
|
{ ignores },
|
|
16
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
|
+
},
|
|
17
39
|
]);
|
|
18
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",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"eslint-config"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@eslint/js": "^
|
|
15
|
-
"eslint": "^
|
|
16
|
-
"typescript": "^
|
|
17
|
-
"typescript-eslint": "^8.
|
|
14
|
+
"@eslint/js": "^10.0.1",
|
|
15
|
+
"eslint": "^10.5.0",
|
|
16
|
+
"typescript": "^6.0.3",
|
|
17
|
+
"typescript-eslint": "^8.61.1"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "0b2cf8519a4fd029222f5d70cb1f94523e1d34de"
|
|
20
20
|
}
|