@donmahallem/eslint-config 2.2.1 → 2.3.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/package.json +5 -5
- package/src/index.js +25 -1
- package/src/index.spec.js +1 -1
- package/src/index.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donmahallem/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "My personal eslint. You better not use it!",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test:coverage": "nyc --nycrc-path ./.nycrc.json npm run test",
|
|
12
12
|
"lint": "eslint -c ./src/index.js ./src",
|
|
13
13
|
"postlint": "prettier --config ./.prettierrc src/* --check",
|
|
14
|
-
"lint:fix": "eslint -c ./
|
|
14
|
+
"lint:fix": "eslint -c ./src/index.js ./src --fix",
|
|
15
15
|
"postlint:fix": "prettier --config ./.prettierrc src/**/*.ts --write",
|
|
16
16
|
"docs": "typedoc --options ./typedoc.json",
|
|
17
17
|
"version": "npm run build:readme"
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"eslint": "~9.20.0",
|
|
49
49
|
"eslint-config-prettier": "~10.0.0",
|
|
50
50
|
"eslint-plugin-chai-friendly": "~1.0.1",
|
|
51
|
-
"eslint-plugin-
|
|
51
|
+
"eslint-plugin-headers": "~1.2.1",
|
|
52
52
|
"eslint-plugin-import": "~2.31.0",
|
|
53
53
|
"eslint-plugin-jsdoc": "~50.6.0",
|
|
54
54
|
"eslint-plugin-mocha": "~10.5.0",
|
|
55
55
|
"eslint-plugin-no-null": "~1.0.2",
|
|
56
56
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
57
|
-
"prettier": "~3.
|
|
57
|
+
"prettier": "~3.5.0",
|
|
58
58
|
"typescript-eslint": "~8.23.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"eslint-plugin-jsdoc": "~50.6.0",
|
|
68
68
|
"eslint-plugin-no-null": "~1.0.2",
|
|
69
69
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
70
|
-
"prettier": "~3.
|
|
70
|
+
"prettier": "~3.5.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@appnest/readme": "1.2.7",
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Package @donmahallem/eslint-config
|
|
3
|
+
* Source https://github.com/donmahallem/eslint-config
|
|
4
|
+
*
|
|
5
|
+
* @ts-check
|
|
6
|
+
*/
|
|
2
7
|
|
|
8
|
+
import { readFileSync } from 'node:fs';
|
|
9
|
+
import { join as pathJoin } from 'node:path';
|
|
3
10
|
import eslint from '@eslint/js';
|
|
4
11
|
import tseslint from 'typescript-eslint';
|
|
5
12
|
import mochaPlugin from 'eslint-plugin-mocha';
|
|
6
13
|
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
|
|
14
|
+
import headers from 'eslint-plugin-headers';
|
|
15
|
+
// eslint-disable-next-line no-undef
|
|
16
|
+
const packageInfo = JSON.parse(readFileSync(pathJoin(process.cwd(), 'package.json')));
|
|
7
17
|
|
|
8
18
|
export default tseslint.config(
|
|
9
19
|
eslint.configs.recommended,
|
|
@@ -15,5 +25,19 @@ export default tseslint.config(
|
|
|
15
25
|
rules: {
|
|
16
26
|
'@typescript-eslint/no-unused-expressions': 'off',
|
|
17
27
|
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
plugins: {
|
|
31
|
+
headers,
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
'headers/header-format': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
source: 'string',
|
|
38
|
+
content: `Package ${packageInfo.name}\nSource ${packageInfo.homepage}`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
18
42
|
}
|
|
19
43
|
);
|
package/src/index.spec.js
CHANGED