@nice-move/eslint-config-base 0.15.10 → 0.16.1
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/unicorn.mjs +11 -4
- package/lib/utils.mjs +6 -5
- package/package.json +10 -10
package/lib/unicorn.mjs
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
2
2
|
|
|
3
|
+
const files = ['**/*.{js,jsx,ts,tsx,mjs,mts,cjs,cts,qs,wxs,vue,html,htm}'];
|
|
4
|
+
|
|
3
5
|
export default [
|
|
4
|
-
eslintPluginUnicorn.configs.recommended,
|
|
5
6
|
{
|
|
7
|
+
files,
|
|
8
|
+
...eslintPluginUnicorn.configs.recommended,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
files,
|
|
6
12
|
rules: {
|
|
7
13
|
'unicorn/consistent-destructuring': 'off',
|
|
8
14
|
'unicorn/custom-error-definition': 'warn',
|
|
9
15
|
'unicorn/expiring-todo-comments': 'off',
|
|
10
16
|
'unicorn/import-style': 'off',
|
|
11
|
-
'unicorn/no-
|
|
17
|
+
'unicorn/no-for-each': 'off',
|
|
18
|
+
'unicorn/prefer-await': 'off',
|
|
12
19
|
'unicorn/no-array-reduce': 'off',
|
|
13
20
|
'unicorn/no-null': 'off',
|
|
14
21
|
'unicorn/no-useless-undefined': 'off',
|
|
@@ -16,12 +23,12 @@ export default [
|
|
|
16
23
|
'warn',
|
|
17
24
|
{ onlyIfContainsSeparator: true },
|
|
18
25
|
],
|
|
19
|
-
'unicorn/prefer-export-from': ['error', {
|
|
26
|
+
'unicorn/prefer-export-from': ['error', { checkUsedVariables: false }],
|
|
20
27
|
'unicorn/prefer-global-this': 0,
|
|
21
28
|
'unicorn/prefer-prototype-methods': 'off',
|
|
22
29
|
'unicorn/prefer-set-has': 'off',
|
|
23
30
|
'unicorn/prefer-top-level-await': 'off',
|
|
24
|
-
'unicorn/
|
|
31
|
+
'unicorn/name-replacements': 'off',
|
|
25
32
|
'unicorn/relative-url-style': ['error', 'always'],
|
|
26
33
|
'unicorn/require-post-message-target-origin': 'off',
|
|
27
34
|
'unicorn/template-indent': 'off',
|
package/lib/utils.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
2
3
|
|
|
3
4
|
import globals from 'globals';
|
|
4
5
|
import { getPkg } from 'settingz';
|
|
5
6
|
|
|
6
|
-
export const require = createRequire(import.meta.url);
|
|
7
|
-
|
|
8
7
|
export function pkgHas(checker, getResult) {
|
|
9
8
|
const pkg = getPkg();
|
|
10
9
|
|
|
@@ -19,8 +18,10 @@ export function pkgHas(checker, getResult) {
|
|
|
19
18
|
|
|
20
19
|
function getConfig(name) {
|
|
21
20
|
try {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const url = import.meta.resolve('@nice-move/config/package.json');
|
|
22
|
+
const config = JSON.parse(readFileSync(fileURLToPath(url), 'utf8'));
|
|
23
|
+
|
|
24
|
+
return config[name];
|
|
24
25
|
} catch {
|
|
25
26
|
return null;
|
|
26
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/eslint-config-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "A `eslint` config for best practice",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"main": "index.mjs",
|
|
35
35
|
"type": "module",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
38
|
-
"@eslint/eslintrc": "^3.3.
|
|
39
|
-
"@eslint/js": "^
|
|
37
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
|
|
38
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
39
|
+
"@eslint/js": "^10.0.1",
|
|
40
40
|
"@eslint/markdown": "^8.0.3",
|
|
41
41
|
"@nice-move/eslint-plugin-html": "^0.1.1",
|
|
42
42
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"eslint-plugin-import-x": "^4.17.1",
|
|
45
45
|
"eslint-plugin-n": "^18.3.0",
|
|
46
46
|
"eslint-plugin-promise": "^7.3.0",
|
|
47
|
-
"eslint-plugin-regexp": "^3.
|
|
48
|
-
"eslint-plugin-unicorn": "^
|
|
49
|
-
"espree": "^
|
|
47
|
+
"eslint-plugin-regexp": "^3.3.1",
|
|
48
|
+
"eslint-plugin-unicorn": "^74.0.0",
|
|
49
|
+
"espree": "^11.2.0",
|
|
50
50
|
"globals": "^17.11.0",
|
|
51
51
|
"settingz": "^0.2.0",
|
|
52
|
-
"typescript-eslint": "^8.
|
|
52
|
+
"typescript-eslint": "^8.70.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"eslint": "^9.
|
|
55
|
+
"eslint": "^10.9.1"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": "
|
|
58
|
+
"node": "^24.0.0"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|