@w5s/eslint-config 2.0.3 → 2.0.5
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/dist/rules/es/import.js +4 -4
- package/dist/rules/es/jsdoc.js +2 -2
- package/dist/rules/es/promise.js +1 -1
- package/dist/rules/es/unicorn.js +9 -9
- package/dist/rules/ignore.js +2 -1
- package/dist/rules/jest.js +2 -2
- package/dist/rules/jsonc.js +17 -17
- package/dist/rules/typescript.js +4 -4
- package/dist/rules/yml.js +14 -0
- package/dist/yml.js +6 -1
- package/package.json +5 -5
- package/src/rules/ignore.ts +1 -0
- package/src/rules/yml.ts +14 -0
- package/src/yml.ts +7 -1
package/dist/rules/es/import.js
CHANGED
|
@@ -19,7 +19,7 @@ const config = dev_1.ESLintConfig.concat(imports_1.default,
|
|
|
19
19
|
// mjs: 'never',
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
|
-
'import/no-deprecated': 'off',
|
|
22
|
+
'import/no-deprecated': 'off', // Performance issues
|
|
23
23
|
'import/no-extraneous-dependencies': [
|
|
24
24
|
'error',
|
|
25
25
|
{
|
|
@@ -33,9 +33,9 @@ const config = dev_1.ESLintConfig.concat(imports_1.default,
|
|
|
33
33
|
],
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
|
-
'import/no-named-as-default': 'off',
|
|
37
|
-
'import/no-unused-modules': 'off',
|
|
38
|
-
'import/prefer-default-export': 'off',
|
|
36
|
+
'import/no-named-as-default': 'off', // Performance issues
|
|
37
|
+
'import/no-unused-modules': 'off', // Performance issues
|
|
38
|
+
'import/prefer-default-export': 'off', // Not aligned, default export does not bring sufficient semantic
|
|
39
39
|
'import/unambiguous': dev_1.ESLintConfig.fixme('off'), // Disable because proposal still in progress
|
|
40
40
|
},
|
|
41
41
|
settings: {
|
package/dist/rules/es/jsdoc.js
CHANGED
|
@@ -3,13 +3,13 @@ const config = {
|
|
|
3
3
|
extends: ['plugin:jsdoc/recommended'],
|
|
4
4
|
plugins: ['jsdoc'],
|
|
5
5
|
rules: {
|
|
6
|
-
'jsdoc/no-undefined-types': 'off',
|
|
6
|
+
'jsdoc/no-undefined-types': 'off', // https://github.com/gajus/eslint-plugin-jsdoc/issues/839
|
|
7
7
|
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'],
|
|
8
8
|
'jsdoc/require-jsdoc': 'off',
|
|
9
9
|
'jsdoc/require-param-description': 'off',
|
|
10
10
|
'jsdoc/require-returns': 'off',
|
|
11
11
|
'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }],
|
|
12
|
-
'jsdoc/valid-types': 'off',
|
|
12
|
+
'jsdoc/valid-types': 'off', // FIXME: reports lots of false positive
|
|
13
13
|
strict: ['error', 'safe'],
|
|
14
14
|
},
|
|
15
15
|
settings: {
|
package/dist/rules/es/promise.js
CHANGED
|
@@ -4,7 +4,7 @@ const config = dev_1.ESLintConfig.concat({
|
|
|
4
4
|
extends: ['plugin:promise/recommended'],
|
|
5
5
|
plugins: ['promise'],
|
|
6
6
|
rules: {
|
|
7
|
-
'promise/prefer-await-to-callbacks': dev_1.ESLintConfig.fixme('error'),
|
|
7
|
+
'promise/prefer-await-to-callbacks': dev_1.ESLintConfig.fixme('error'), // https://github.com/xjamundx/eslint-plugin-promise/issues/212
|
|
8
8
|
'promise/prefer-await-to-then': 'error',
|
|
9
9
|
},
|
|
10
10
|
});
|
package/dist/rules/es/unicorn.js
CHANGED
|
@@ -16,16 +16,16 @@ const config = dev_1.ESLintConfig.concat(recommended_js_1.default, {
|
|
|
16
16
|
'unicorn/error-message': 'error',
|
|
17
17
|
'unicorn/explicit-length-check': ['error', { 'non-zero': 'greater-than' }],
|
|
18
18
|
'unicorn/filename-case': 'off',
|
|
19
|
-
'unicorn/import-index': 'off',
|
|
20
|
-
'unicorn/new-for-builtins': 'off',
|
|
19
|
+
'unicorn/import-index': 'off', // Not playing well with ES Module
|
|
20
|
+
'unicorn/new-for-builtins': 'off', // error, @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/122
|
|
21
21
|
'unicorn/no-abusive-eslint-disable': 'error',
|
|
22
22
|
'unicorn/no-array-instanceof': 'error',
|
|
23
23
|
'unicorn/no-console-spaces': 'off',
|
|
24
|
-
'unicorn/no-fn-reference-in-iterator': 'off',
|
|
24
|
+
'unicorn/no-fn-reference-in-iterator': 'off', // error ?
|
|
25
25
|
'unicorn/no-for-loop': 'error',
|
|
26
26
|
'unicorn/no-hex-escape': 'error',
|
|
27
27
|
'unicorn/no-new-buffer': 'error',
|
|
28
|
-
'unicorn/no-null': 'off',
|
|
28
|
+
'unicorn/no-null': 'off', // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/612
|
|
29
29
|
'unicorn/no-process-exit': 'off',
|
|
30
30
|
'unicorn/no-unreadable-array-destructuring': 'off',
|
|
31
31
|
'unicorn/no-unsafe-regex': 'error',
|
|
@@ -60,11 +60,11 @@ const config = dev_1.ESLintConfig.concat(recommended_js_1.default, {
|
|
|
60
60
|
],
|
|
61
61
|
rules: {
|
|
62
62
|
'unicorn/consistent-destructuring': 'off',
|
|
63
|
-
'unicorn/consistent-function-scoping': 'off',
|
|
64
|
-
'unicorn/no-array-callback-reference': 'off',
|
|
65
|
-
'unicorn/no-array-for-each': 'off',
|
|
66
|
-
'unicorn/no-array-method-this-argument': 'off',
|
|
67
|
-
'unicorn/no-array-reduce': 'off',
|
|
63
|
+
'unicorn/consistent-function-scoping': 'off', // Too many false positive
|
|
64
|
+
'unicorn/no-array-callback-reference': 'off', // Many false positive reported
|
|
65
|
+
'unicorn/no-array-for-each': 'off', // This rule could change browser compatibility
|
|
66
|
+
'unicorn/no-array-method-this-argument': 'off', // Many false positive reported
|
|
67
|
+
'unicorn/no-array-reduce': 'off', // Array#reduce can be used
|
|
68
68
|
'unicorn/no-object-as-default-parameter': 'off',
|
|
69
69
|
'unicorn/prefer-default-parameters': 'off',
|
|
70
70
|
'unicorn/prevent-abbreviations': 'off', // This rule is so dangerous : it potentially break code while fixing in many cases !!
|
package/dist/rules/ignore.js
CHANGED
|
@@ -19,6 +19,7 @@ const getGitignore = (prefix = '') => {
|
|
|
19
19
|
const config = {
|
|
20
20
|
ignorePatterns: [
|
|
21
21
|
'!.*',
|
|
22
|
+
'.docusaurus',
|
|
22
23
|
'.yarn',
|
|
23
24
|
'.common/',
|
|
24
25
|
'.config/package-lock.json',
|
|
@@ -41,7 +42,7 @@ const config = {
|
|
|
41
42
|
'**/vendors/**',
|
|
42
43
|
'*.min.*',
|
|
43
44
|
'*.toml',
|
|
44
|
-
'*.timestamp-*.mjs',
|
|
45
|
+
'*.timestamp-*.mjs', // esbuild/vite temporary files
|
|
45
46
|
...getGitignore(),
|
|
46
47
|
...getGitignore('android'),
|
|
47
48
|
...getGitignore('ios'),
|
package/dist/rules/jest.js
CHANGED
|
@@ -11,7 +11,7 @@ const config = dev_1.ESLintConfig.concat({
|
|
|
11
11
|
plugins: ['jest'],
|
|
12
12
|
rules: {
|
|
13
13
|
'jest/consistent-test-it': 'error',
|
|
14
|
-
'jest/expect-expect': 'off',
|
|
14
|
+
'jest/expect-expect': 'off', // Disabled because it does not handle functions that does the expect
|
|
15
15
|
'jest/no-alias-methods': 'error',
|
|
16
16
|
'jest/prefer-spy-on': 'error',
|
|
17
17
|
'jest/prefer-to-contain': 'error',
|
|
@@ -44,7 +44,7 @@ const config = dev_1.ESLintConfig.concat({
|
|
|
44
44
|
*/
|
|
45
45
|
{
|
|
46
46
|
rules: {
|
|
47
|
-
'@typescript-eslint/dot-notation': dev_1.ESLintConfig.fixme(undefined),
|
|
47
|
+
'@typescript-eslint/dot-notation': dev_1.ESLintConfig.fixme(undefined), // eslint-plugin-jest seems to break this rule
|
|
48
48
|
'@typescript-eslint/naming-convention': 'off',
|
|
49
49
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
50
50
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
package/dist/rules/jsonc.js
CHANGED
|
@@ -41,8 +41,8 @@ const config = {
|
|
|
41
41
|
'license',
|
|
42
42
|
'qna',
|
|
43
43
|
'author',
|
|
44
|
-
'maintainers',
|
|
45
|
-
'contributors',
|
|
44
|
+
'maintainers', // Key order (per item): name, email, url
|
|
45
|
+
'contributors', // Key order (per item): name, email, url
|
|
46
46
|
'publisher',
|
|
47
47
|
'sideEffects',
|
|
48
48
|
'type',
|
|
@@ -67,16 +67,16 @@ const config = {
|
|
|
67
67
|
'assets',
|
|
68
68
|
'bin',
|
|
69
69
|
'man',
|
|
70
|
-
'directories',
|
|
71
|
-
'files',
|
|
70
|
+
'directories', // Key order: lib, bin, man, doc, example, test
|
|
71
|
+
'files', // Unique items
|
|
72
72
|
'workspaces',
|
|
73
|
-
'binary',
|
|
74
|
-
'scripts',
|
|
75
|
-
'betterScripts',
|
|
73
|
+
'binary', // Key order: module_name, module_path, remote_path, package_name, host
|
|
74
|
+
'scripts', // Script sort
|
|
75
|
+
'betterScripts', // Script sort
|
|
76
76
|
'contributes',
|
|
77
|
-
'activationEvents',
|
|
78
|
-
'husky',
|
|
79
|
-
'simple-git-hooks',
|
|
77
|
+
'activationEvents', // Unique items
|
|
78
|
+
'husky', // Sorts the hooks field using git hook sort
|
|
79
|
+
'simple-git-hooks', // Key sort using git hook sort
|
|
80
80
|
'pre-commit',
|
|
81
81
|
'commitlint',
|
|
82
82
|
'lint-staged',
|
|
@@ -86,10 +86,10 @@ const config = {
|
|
|
86
86
|
'babel',
|
|
87
87
|
'browserslist',
|
|
88
88
|
'xo',
|
|
89
|
-
'prettier',
|
|
90
|
-
'eslintConfig',
|
|
89
|
+
'prettier', // Prettier sort
|
|
90
|
+
'eslintConfig', // ESLint sort
|
|
91
91
|
'eslintIgnore',
|
|
92
|
-
'npmpackagejsonlint',
|
|
92
|
+
'npmpackagejsonlint', // Key sort (also recognizes: npmPackageJsonLintConfig, npmpkgjsonlint)
|
|
93
93
|
'release',
|
|
94
94
|
'remarkConfig',
|
|
95
95
|
'stylelint',
|
|
@@ -101,9 +101,9 @@ const config = {
|
|
|
101
101
|
'resolutions',
|
|
102
102
|
'dependencies',
|
|
103
103
|
'devDependencies',
|
|
104
|
-
'dependenciesMeta',
|
|
104
|
+
'dependenciesMeta', // Key sort (deep)
|
|
105
105
|
'peerDependencies',
|
|
106
|
-
'peerDependenciesMeta',
|
|
106
|
+
'peerDependenciesMeta', // Key sort (deep)
|
|
107
107
|
'optionalDependencies',
|
|
108
108
|
'bundledDependencies',
|
|
109
109
|
'bundleDependencies',
|
|
@@ -113,14 +113,14 @@ const config = {
|
|
|
113
113
|
'packageManager',
|
|
114
114
|
'engines',
|
|
115
115
|
'engineStrict',
|
|
116
|
-
'volta',
|
|
116
|
+
'volta', // Key order: node, npm, yarn
|
|
117
117
|
'languageName',
|
|
118
118
|
'os',
|
|
119
119
|
'cpu',
|
|
120
120
|
'preferGlobal',
|
|
121
121
|
'publishConfig',
|
|
122
122
|
'icon',
|
|
123
|
-
'badges',
|
|
123
|
+
'badges', // Key order (per item): description, url, href
|
|
124
124
|
'galleryBanner',
|
|
125
125
|
'preview',
|
|
126
126
|
'markdown',
|
package/dist/rules/typescript.js
CHANGED
|
@@ -89,7 +89,7 @@ const config = dev_1.ESLintConfig.concat(
|
|
|
89
89
|
'@typescript-eslint/no-dupe-class-members': baseRules['no-dupe-class-members'],
|
|
90
90
|
'@typescript-eslint/no-empty-function': baseRules['no-empty-function'],
|
|
91
91
|
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
|
|
92
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
92
|
+
'@typescript-eslint/no-explicit-any': 'off', // if any is explicit then it's wanted
|
|
93
93
|
'@typescript-eslint/no-extra-parens': baseRules['no-extra-parens'],
|
|
94
94
|
'@typescript-eslint/no-extra-semi': baseRules['no-extra-semi'],
|
|
95
95
|
'@typescript-eslint/no-inferrable-types': 'error',
|
|
@@ -97,7 +97,7 @@ const config = dev_1.ESLintConfig.concat(
|
|
|
97
97
|
'@typescript-eslint/no-loss-of-precision': baseRules['no-loss-of-precision'],
|
|
98
98
|
'@typescript-eslint/no-magic-numbers': baseRules['no-magic-numbers'],
|
|
99
99
|
'@typescript-eslint/no-misused-new': 'error',
|
|
100
|
-
'@typescript-eslint/no-namespace': 'off',
|
|
100
|
+
'@typescript-eslint/no-namespace': 'off', // We don't agree with community, namespaces are great and not deprecated
|
|
101
101
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
102
102
|
'@typescript-eslint/no-redeclare': dev_1.ESLintConfig.fixme(baseRules['no-redeclare']),
|
|
103
103
|
'@typescript-eslint/no-require-imports': 'error',
|
|
@@ -192,7 +192,7 @@ const config = dev_1.ESLintConfig.concat(
|
|
|
192
192
|
'func-call-spacing': 'off',
|
|
193
193
|
'getter-return': 'off',
|
|
194
194
|
'import/default': duplicateTSC,
|
|
195
|
-
'import/export': dev_1.ESLintConfig.fixme('error'),
|
|
195
|
+
'import/export': dev_1.ESLintConfig.fixme('error'), // https://github.com/benmosher/eslint-plugin-import/issues/1964
|
|
196
196
|
'import/named': duplicateTSC,
|
|
197
197
|
'import/namespace': duplicateTSC,
|
|
198
198
|
'import/no-named-as-default-member': duplicateTSC,
|
|
@@ -211,7 +211,7 @@ const config = dev_1.ESLintConfig.concat(
|
|
|
211
211
|
'no-func-assign': 'off',
|
|
212
212
|
'no-implied-eval': 'off',
|
|
213
213
|
'no-import-assign': 'off',
|
|
214
|
-
'no-inner-declarations': dev_1.ESLintConfig.fixme('error'),
|
|
214
|
+
'no-inner-declarations': dev_1.ESLintConfig.fixme('error'), // https://github.com/typescript-eslint/typescript-eslint/issues/239
|
|
215
215
|
'no-loop-func': 'off',
|
|
216
216
|
'no-loss-of-precision': 'off',
|
|
217
217
|
'no-magic-numbers': 'off',
|
package/dist/rules/yml.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
const dev_1 = require("@w5s/dev");
|
|
3
|
+
const yamlExtensions = dev_1.Project.queryExtensions(['yaml']);
|
|
2
4
|
const config = {
|
|
3
5
|
extends: ['plugin:yml/standard', 'plugin:yml/prettier'],
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: [
|
|
9
|
+
...yamlExtensions.map((ext) => `docker-compose*${ext}`),
|
|
10
|
+
...yamlExtensions.map((ext) => `compose-*${ext}`),
|
|
11
|
+
...yamlExtensions.map((ext) => `compose${ext}`),
|
|
12
|
+
],
|
|
13
|
+
rules: {
|
|
14
|
+
'yml/no-empty-mapping-value': 'off',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
4
18
|
parser: 'yaml-eslint-parser',
|
|
5
19
|
plugins: ['yml'],
|
|
6
20
|
};
|
package/dist/yml.js
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
|
+
const dev_1 = require("@w5s/dev");
|
|
5
6
|
const yml_js_1 = __importDefault(require("./rules/yml.js"));
|
|
6
7
|
const config = {
|
|
7
8
|
overrides: [
|
|
8
9
|
{
|
|
9
10
|
...yml_js_1.default,
|
|
10
|
-
files: [
|
|
11
|
+
files: [
|
|
12
|
+
dev_1.Project.extensionsToGlob(
|
|
13
|
+
// ts only extensions
|
|
14
|
+
dev_1.Project.queryExtensions(['yaml'])),
|
|
15
|
+
],
|
|
11
16
|
},
|
|
12
17
|
],
|
|
13
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
37
37
|
"@typescript-eslint/parser": "^6.0.0",
|
|
38
|
-
"@w5s/dev": "^2.0.
|
|
39
|
-
"@w5s/prettier-config": "^2.0.
|
|
38
|
+
"@w5s/dev": "^2.0.5",
|
|
39
|
+
"@w5s/prettier-config": "^2.0.2",
|
|
40
40
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
41
41
|
"eslint-config-prettier": "^9.0.0",
|
|
42
42
|
"eslint-plugin-import": "^2.25.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint-plugin-jsonc": "^2.4.0",
|
|
46
46
|
"eslint-plugin-prettier": "^5.0.0-alpha.0",
|
|
47
47
|
"eslint-plugin-promise": "^6.0.0",
|
|
48
|
-
"eslint-plugin-unicorn": "^
|
|
48
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
49
49
|
"eslint-plugin-yml": "^1.1.0",
|
|
50
50
|
"find-up": "^5.0.0",
|
|
51
51
|
"parse-gitignore": "^2.0.0"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "2bd0a857bdad976886f91a11ab9b2928c59095be"
|
|
73
73
|
}
|
package/src/rules/ignore.ts
CHANGED
package/src/rules/yml.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { Project } from '@w5s/dev';
|
|
1
2
|
import type eslint from 'eslint';
|
|
2
3
|
|
|
4
|
+
const yamlExtensions = Project.queryExtensions(['yaml']);
|
|
3
5
|
const config: eslint.Linter.Config = {
|
|
4
6
|
extends: ['plugin:yml/standard', 'plugin:yml/prettier'],
|
|
7
|
+
overrides: [
|
|
8
|
+
{
|
|
9
|
+
files: [
|
|
10
|
+
...yamlExtensions.map((ext) => `docker-compose*${ext}`),
|
|
11
|
+
...yamlExtensions.map((ext) => `compose-*${ext}`),
|
|
12
|
+
...yamlExtensions.map((ext) => `compose${ext}`),
|
|
13
|
+
],
|
|
14
|
+
rules: {
|
|
15
|
+
'yml/no-empty-mapping-value': 'off',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
],
|
|
5
19
|
parser: 'yaml-eslint-parser',
|
|
6
20
|
plugins: ['yml'],
|
|
7
21
|
};
|
package/src/yml.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type eslint from 'eslint';
|
|
2
|
+
import { Project } from '@w5s/dev';
|
|
2
3
|
import ymlConfig from './rules/yml.js';
|
|
3
4
|
|
|
4
5
|
const config: eslint.Linter.Config = {
|
|
5
6
|
overrides: [
|
|
6
7
|
{
|
|
7
8
|
...ymlConfig,
|
|
8
|
-
files: [
|
|
9
|
+
files: [
|
|
10
|
+
Project.extensionsToGlob(
|
|
11
|
+
// ts only extensions
|
|
12
|
+
Project.queryExtensions(['yaml'])
|
|
13
|
+
),
|
|
14
|
+
],
|
|
9
15
|
},
|
|
10
16
|
],
|
|
11
17
|
};
|