@mscharley/eslint-config 4.0.5 → 4.0.6
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 +7 -0
- package/README.md +2 -1
- package/package.json +4 -3
- package/rules/index.js +4 -0
- package/rules/mpl2.js +21 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -23,10 +23,11 @@ $ npm install --save-dev @mscharley/eslint-config
|
|
|
23
23
|
// eslint.config.js
|
|
24
24
|
import { configs, withStyles } from "@mscharley/eslint-config";
|
|
25
25
|
|
|
26
|
-
export
|
|
26
|
+
export default [
|
|
27
27
|
...configs.recommended,
|
|
28
28
|
...configs.node, // For projects running on NodeJS
|
|
29
29
|
// ...configs.react, // For projects running React
|
|
30
|
+
// ...configs.license["MPL-2.0"](), // Some licenses require notices in each source file, and some of these are predefined for convenience
|
|
30
31
|
...withStyles(), // Include formatting rules
|
|
31
32
|
];
|
|
32
33
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mscharley/eslint-config",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./rules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
38
38
|
"eslint-plugin-import": "^2.31.0",
|
|
39
39
|
"eslint-plugin-jest": "^28.8.3",
|
|
40
|
-
"eslint-plugin-n": "^17.
|
|
40
|
+
"eslint-plugin-n": "^17.11.1",
|
|
41
|
+
"eslint-plugin-notice": "^1.0.0",
|
|
41
42
|
"eslint-plugin-react": "^7.37.1",
|
|
42
|
-
"eslint-plugin-react-hooks": "5.1.0-
|
|
43
|
+
"eslint-plugin-react-hooks": "5.1.0-rc-fb9a90fa48-20240614",
|
|
43
44
|
"typescript": "^5.6.3",
|
|
44
45
|
"typescript-eslint": "^8.8.1"
|
|
45
46
|
},
|
package/rules/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import typescript, { disableTypeCheckedRules } from './typescript.js';
|
|
2
2
|
import eslint from './eslint.js';
|
|
3
|
+
import mpl2 from './mpl2.js';
|
|
3
4
|
import node from './node.js';
|
|
4
5
|
import react from './react.js';
|
|
5
6
|
import stylistic from '@stylistic/eslint-plugin';
|
|
@@ -14,6 +15,9 @@ export const configs = {
|
|
|
14
15
|
],
|
|
15
16
|
node,
|
|
16
17
|
react,
|
|
18
|
+
license: {
|
|
19
|
+
'MPL-2.0': mpl2,
|
|
20
|
+
},
|
|
17
21
|
};
|
|
18
22
|
|
|
19
23
|
export const withStyles = () => [
|
package/rules/mpl2.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import notice from 'eslint-plugin-notice';
|
|
2
|
+
|
|
3
|
+
export default (...files) => [{
|
|
4
|
+
plugins: { notice },
|
|
5
|
+
files: files.length === 0 ? ['**/*.{ts,js,tsx,jsx}'] : files,
|
|
6
|
+
rules: {
|
|
7
|
+
'notice/notice': [
|
|
8
|
+
'error',
|
|
9
|
+
{
|
|
10
|
+
template:
|
|
11
|
+
'/**\n'
|
|
12
|
+
+ ' * This Source Code Form is subject to the terms of the Mozilla Public\n'
|
|
13
|
+
+ ' * License, v. 2.0. If a copy of the MPL was not distributed with this\n'
|
|
14
|
+
+ ' * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n'
|
|
15
|
+
+ ' */\n\n',
|
|
16
|
+
// The package entrypoint needs some extra grace since the first comment must be the @packageDocumentation.
|
|
17
|
+
chars: 5000,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
}];
|