@newsteam/eslint-config 0.0.124 → 0.0.127
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/lib/cjs/index.js +1 -2
- package/lib/cjs/plugins/postcss-modules.d.ts +12 -0
- package/lib/cjs/plugins/postcss-modules.js +19 -0
- package/lib/cjs/plugins/unicorn.d.ts +2 -1
- package/lib/cjs/plugins/unicorn.js +12 -6
- package/lib/cjs/rules.js +1 -2
- package/lib/cjs/test/test-css-module-import-with-nesting.d.ts +1 -0
- package/lib/cjs/test/test-css-module-import-with-nesting.js +7 -0
- package/package.json +21 -20
- package/lib/cjs/plugins/css-modules.d.ts +0 -17
- package/lib/cjs/plugins/css-modules.js +0 -41
- package/lib/cjs/plugins/webassembly.d.ts +0 -7
- package/lib/cjs/plugins/webassembly.js +0 -17
package/lib/cjs/index.js
CHANGED
|
@@ -8,7 +8,6 @@ module.exports = {
|
|
|
8
8
|
},
|
|
9
9
|
extends: [
|
|
10
10
|
"./plugins/array-function",
|
|
11
|
-
"./plugins/css-modules",
|
|
12
11
|
"./plugins/es",
|
|
13
12
|
"./plugins/eslint-comments",
|
|
14
13
|
"./plugins/filenames",
|
|
@@ -20,6 +19,7 @@ module.exports = {
|
|
|
20
19
|
"./plugins/no-useless-assign",
|
|
21
20
|
"./plugins/node",
|
|
22
21
|
"./plugins/optimize-regex",
|
|
22
|
+
"./plugins/postcss-modules",
|
|
23
23
|
"./plugins/prefer-object-spread",
|
|
24
24
|
"./plugins/promise",
|
|
25
25
|
"./plugins/react",
|
|
@@ -30,7 +30,6 @@ module.exports = {
|
|
|
30
30
|
"./plugins/sort-keys-fix",
|
|
31
31
|
"./plugins/typescript",
|
|
32
32
|
"./plugins/unicorn",
|
|
33
|
-
"./plugins/webassembly",
|
|
34
33
|
"./rules"
|
|
35
34
|
].map(function (string) { return require.resolve(string); }),
|
|
36
35
|
overrides: overrides_1.overrides,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Like eslint-plugin-css-modules, this plugin helps you lint your css modules.
|
|
4
|
+
* It adds a new eslint rule that detects if you are trying to use a class that
|
|
5
|
+
* is not exported by your css module.
|
|
6
|
+
*
|
|
7
|
+
* https://www.npmjs.com/package/eslint-plugin-postcss-modules
|
|
8
|
+
*/
|
|
9
|
+
module.exports = {
|
|
10
|
+
plugins: ["postcss-modules"],
|
|
11
|
+
rules: {
|
|
12
|
+
"postcss-modules/no-undef-class": "error",
|
|
13
|
+
"postcss-modules/no-unused-class": "warn"
|
|
14
|
+
},
|
|
15
|
+
settings: {
|
|
16
|
+
camelCase: true,
|
|
17
|
+
include: "**/*.module.css"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -16,7 +16,6 @@ declare const _default: {
|
|
|
16
16
|
"unicorn/filename-case": (string | {
|
|
17
17
|
case: string;
|
|
18
18
|
})[];
|
|
19
|
-
"unicorn/import-index": string;
|
|
20
19
|
"unicorn/import-style": string;
|
|
21
20
|
"unicorn/new-for-builtins": string;
|
|
22
21
|
"unicorn/no-abusive-eslint-disable": string;
|
|
@@ -71,10 +70,12 @@ declare const _default: {
|
|
|
71
70
|
"unicorn/prefer-dom-node-dataset": string;
|
|
72
71
|
"unicorn/prefer-dom-node-remove": string;
|
|
73
72
|
"unicorn/prefer-dom-node-text-content": string;
|
|
73
|
+
"unicorn/prefer-event-target": string;
|
|
74
74
|
"unicorn/prefer-export-from": string;
|
|
75
75
|
"unicorn/prefer-includes": string;
|
|
76
76
|
"unicorn/prefer-json-parse-buffer": string;
|
|
77
77
|
"unicorn/prefer-keyboard-event-key": string;
|
|
78
|
+
"unicorn/prefer-logical-operator-over-ternary": string;
|
|
78
79
|
"unicorn/prefer-math-trunc": string;
|
|
79
80
|
"unicorn/prefer-modern-dom-apis": string;
|
|
80
81
|
"unicorn/prefer-modern-math-apis": string;
|
|
@@ -83,12 +83,6 @@ module.exports = {
|
|
|
83
83
|
case: "kebabCase"
|
|
84
84
|
}
|
|
85
85
|
],
|
|
86
|
-
/*
|
|
87
|
-
* Enforce importing index files with .. (fixable)
|
|
88
|
-
*
|
|
89
|
-
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/import-index.md
|
|
90
|
-
*/
|
|
91
|
-
"unicorn/import-index": "error",
|
|
92
86
|
/*
|
|
93
87
|
* Enforce specific import styles per module
|
|
94
88
|
*
|
|
@@ -426,6 +420,12 @@ module.exports = {
|
|
|
426
420
|
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-dom-node-text-content.md
|
|
427
421
|
*/
|
|
428
422
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
423
|
+
/*
|
|
424
|
+
* While EventEmitter is only available in Node.js, EventTarget is also available in Deno and browsers.
|
|
425
|
+
*
|
|
426
|
+
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-event-target.md
|
|
427
|
+
*/
|
|
428
|
+
"unicorn/prefer-event-target": "error",
|
|
429
429
|
/*
|
|
430
430
|
* Prefer export... from when re-exporting
|
|
431
431
|
*
|
|
@@ -450,6 +450,12 @@ module.exports = {
|
|
|
450
450
|
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-keyboard-event-key.md
|
|
451
451
|
*/
|
|
452
452
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
453
|
+
/*
|
|
454
|
+
* Prefer using a logical operator over a ternary
|
|
455
|
+
*
|
|
456
|
+
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-logical-operator-over-ternary.md
|
|
457
|
+
*/
|
|
458
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
453
459
|
/*
|
|
454
460
|
* Enforce the use of Math.trunc instead of bitwise operators. (partly fixable)
|
|
455
461
|
*
|
package/lib/cjs/rules.js
CHANGED
|
@@ -29,7 +29,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
*/
|
|
30
30
|
var confusing_browser_globals_1 = __importDefault(require("confusing-browser-globals"));
|
|
31
31
|
var settings_1 = require("./settings");
|
|
32
|
-
var isFixMode = process.argv.includes("--fix");
|
|
33
32
|
module.exports = {
|
|
34
33
|
env: {
|
|
35
34
|
es6: true
|
|
@@ -125,7 +124,7 @@ module.exports = {
|
|
|
125
124
|
* https://eslint.org/docs/rules/capitalized-comments
|
|
126
125
|
*/
|
|
127
126
|
"capitalized-comments": [
|
|
128
|
-
|
|
127
|
+
"error",
|
|
129
128
|
"always",
|
|
130
129
|
{
|
|
131
130
|
ignoreConsecutiveComments: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var test_css_module_import_with_nesting_module_css_1 = __importDefault(require("./test-css-module-import-with-nesting.module.css"));
|
|
7
|
+
console.log(test_css_module_import_with_nesting_module_css_1.default.parent, test_css_module_import_with_nesting_module_css_1.default.child);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newsteam/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.127",
|
|
4
4
|
"description": "Shared config for eslint",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"types": "./lib/cjs/index.d.ts",
|
|
@@ -43,20 +43,19 @@
|
|
|
43
43
|
"lib"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"
|
|
47
|
-
"confusing-browser-globals": "1.0.11",
|
|
48
|
-
"eslint-import-resolver-typescript": "2.7.1",
|
|
49
|
-
"eslint-plugin-import-newlines": "^1.2.2"
|
|
46
|
+
"confusing-browser-globals": "1.0.11"
|
|
50
47
|
},
|
|
51
48
|
"devDependencies": {
|
|
52
49
|
"@newsteam/jasmine": "0.0.40",
|
|
53
|
-
"@types/eslint": "8.4.
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@
|
|
57
|
-
"@typescript-eslint/
|
|
58
|
-
"eslint": "
|
|
50
|
+
"@types/eslint": "8.4.5",
|
|
51
|
+
"@types/modernizr": "^3.5.3",
|
|
52
|
+
"@types/node": "18.0.3",
|
|
53
|
+
"@types/react": "18.0.15",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "5.30.5",
|
|
55
|
+
"@typescript-eslint/parser": "5.30.5",
|
|
56
|
+
"eslint": "8.19.0",
|
|
59
57
|
"eslint-find-rules": "4.1.0",
|
|
58
|
+
"eslint-import-resolver-typescript": "^3.2.5",
|
|
60
59
|
"eslint-plugin-array-func": "3.1.7",
|
|
61
60
|
"eslint-plugin-css-modules": "2.11.0",
|
|
62
61
|
"eslint-plugin-es": "4.1.0",
|
|
@@ -64,29 +63,31 @@
|
|
|
64
63
|
"eslint-plugin-filenames": "1.3.2",
|
|
65
64
|
"eslint-plugin-format-message": "6.2.4",
|
|
66
65
|
"eslint-plugin-import": "2.26.0",
|
|
66
|
+
"eslint-plugin-import-newlines": "^1.2.3",
|
|
67
67
|
"eslint-plugin-more": "1.0.5",
|
|
68
68
|
"eslint-plugin-no-unsanitized": "4.0.1",
|
|
69
69
|
"eslint-plugin-no-useless-assign": "1.0.3",
|
|
70
70
|
"eslint-plugin-node": "11.1.0",
|
|
71
71
|
"eslint-plugin-optimize-regex": "1.2.1",
|
|
72
|
+
"eslint-plugin-postcss-modules": "^2.0.0",
|
|
72
73
|
"eslint-plugin-prefer-object-spread": "1.2.1",
|
|
73
74
|
"eslint-plugin-promise": "6.0.0",
|
|
74
|
-
"eslint-plugin-react": "7.30.
|
|
75
|
+
"eslint-plugin-react": "7.30.1",
|
|
75
76
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
76
77
|
"eslint-plugin-react-native": "4.0.0",
|
|
77
78
|
"eslint-plugin-react-perf": "3.3.1",
|
|
78
79
|
"eslint-plugin-security": "1.5.0",
|
|
79
80
|
"eslint-plugin-sort-keys-fix": "1.1.2",
|
|
80
|
-
"eslint-plugin-unicorn": "
|
|
81
|
-
"eslint-plugin-webassembly": "1.11.1",
|
|
81
|
+
"eslint-plugin-unicorn": "43.0.1",
|
|
82
82
|
"json-schema": "0.4.0",
|
|
83
|
+
"postcss-nesting": "^10.1.10",
|
|
83
84
|
"react": "18.2.0",
|
|
84
85
|
"typescript": "4.7.4"
|
|
85
86
|
},
|
|
86
87
|
"peerDependencies": {
|
|
87
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
88
|
-
"@typescript-eslint/parser": "5.
|
|
89
|
-
"eslint": "8.
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "5.30.5",
|
|
89
|
+
"@typescript-eslint/parser": "5.30.5",
|
|
90
|
+
"eslint": "8.19.0",
|
|
90
91
|
"eslint-plugin-array-func": "3.1.7",
|
|
91
92
|
"eslint-plugin-css-modules": "2.11.0",
|
|
92
93
|
"eslint-plugin-es": "4.1.0",
|
|
@@ -99,16 +100,16 @@
|
|
|
99
100
|
"eslint-plugin-no-useless-assign": "1.0.3",
|
|
100
101
|
"eslint-plugin-node": "11.1.0",
|
|
101
102
|
"eslint-plugin-optimize-regex": "1.2.1",
|
|
103
|
+
"eslint-plugin-postcss-modules": "^2.0.0",
|
|
102
104
|
"eslint-plugin-prefer-object-spread": "1.2.1",
|
|
103
105
|
"eslint-plugin-promise": "6.0.0",
|
|
104
|
-
"eslint-plugin-react": "7.30.
|
|
106
|
+
"eslint-plugin-react": "7.30.1",
|
|
105
107
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
106
108
|
"eslint-plugin-react-native": "4.0.0",
|
|
107
109
|
"eslint-plugin-react-perf": "3.3.1",
|
|
108
110
|
"eslint-plugin-security": "1.5.0",
|
|
109
111
|
"eslint-plugin-sort-keys-fix": "1.1.2",
|
|
110
|
-
"eslint-plugin-unicorn": "
|
|
111
|
-
"eslint-plugin-webassembly": "1.11.1",
|
|
112
|
+
"eslint-plugin-unicorn": "43.0.1",
|
|
112
113
|
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
|
|
113
114
|
"json-schema": "0.4.0",
|
|
114
115
|
"typescript": "4.7.4"
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
plugins: string[];
|
|
3
|
-
rules: {
|
|
4
|
-
"css-modules/no-undef-class": (string | {
|
|
5
|
-
camelCase: boolean;
|
|
6
|
-
})[];
|
|
7
|
-
"css-modules/no-unused-class": (string | {
|
|
8
|
-
camelCase: boolean;
|
|
9
|
-
})[];
|
|
10
|
-
};
|
|
11
|
-
settings: {
|
|
12
|
-
"css-modules": {
|
|
13
|
-
basePath: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export = _default;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* This plugin intends to help you in tracking down problems when you are using
|
|
4
|
-
* css-modules. It tells if you are using a non-existent css/scss/less class in
|
|
5
|
-
* js or if you forgot to use some classes which you declared in css/scss/less.
|
|
6
|
-
*
|
|
7
|
-
* https://www.npmjs.com/package/eslint-plugin-css-modules
|
|
8
|
-
*/
|
|
9
|
-
module.exports = {
|
|
10
|
-
plugins: ["css-modules"],
|
|
11
|
-
rules: {
|
|
12
|
-
/*
|
|
13
|
-
* You must not use a non existing class, or a property that hasn't been
|
|
14
|
-
* exported using the :export keyword.
|
|
15
|
-
*
|
|
16
|
-
* https://www.npmjs.com/package/eslint-plugin-css-modules#rules
|
|
17
|
-
*/
|
|
18
|
-
"css-modules/no-undef-class": [
|
|
19
|
-
"error",
|
|
20
|
-
{
|
|
21
|
-
camelCase: true
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
/*
|
|
25
|
-
* You must use all the classes defined in css/scss/less file.
|
|
26
|
-
*
|
|
27
|
-
* https://www.npmjs.com/package/eslint-plugin-css-modules#rules
|
|
28
|
-
*/
|
|
29
|
-
"css-modules/no-unused-class": [
|
|
30
|
-
"error",
|
|
31
|
-
{
|
|
32
|
-
camelCase: true
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
settings: {
|
|
37
|
-
"css-modules": {
|
|
38
|
-
basePath: "src"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* ESLint plugin for WebAssembly
|
|
4
|
-
*
|
|
5
|
-
* https://www.npmjs.com/package/eslint-plugin-webassembly
|
|
6
|
-
*/
|
|
7
|
-
module.exports = {
|
|
8
|
-
plugins: ["webassembly"],
|
|
9
|
-
rules: {
|
|
10
|
-
/*
|
|
11
|
-
* Checks that the exports exists
|
|
12
|
-
*
|
|
13
|
-
* https://www.npmjs.com/package/eslint-plugin-webassembly#no-unknown-export
|
|
14
|
-
*/
|
|
15
|
-
"webassembly/no-unknown-export": "error"
|
|
16
|
-
}
|
|
17
|
-
};
|