@w0s/eslint-config 5.3.0 → 6.0.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/README.md +11 -4
- package/eslint.config.js +97 -0
- package/package.json +11 -5
- package/rules/eslint/layout&formatting.js +4 -1
- package/rules/eslint/possible-problems.js +4 -1
- package/rules/eslint/suggestions.js +4 -1
- package/rules/import.js +4 -1
- package/rules/jsdoc.js +4 -1
- package/index.js +0 -73
package/README.md
CHANGED
|
@@ -24,8 +24,15 @@ ESLint configuration file used on my personal website ([w0s.jp](https://github.c
|
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
```javascript
|
|
28
|
+
import w0sConfig from '@w0s/eslint-config';
|
|
29
|
+
|
|
30
|
+
/** @type {import("eslint").Linter.FlatConfig[]} */
|
|
31
|
+
export default [
|
|
32
|
+
...w0sConfig,
|
|
33
|
+
{
|
|
34
|
+
// other options
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
|
|
31
38
|
```
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
4
|
+
import eslintJs from '@eslint/js';
|
|
5
|
+
import pluginJsdoc from 'eslint-plugin-jsdoc';
|
|
6
|
+
import tseslint from 'typescript-eslint';
|
|
7
|
+
import pluginTypeScript from '@typescript-eslint/eslint-plugin';
|
|
8
|
+
import parserTypeScript from '@typescript-eslint/parser';
|
|
9
|
+
import configEslintLayoutFormatting from './rules/eslint/layout&formatting.js';
|
|
10
|
+
import configEslintPossibleProblems from './rules/eslint/possible-problems.js';
|
|
11
|
+
import configEslintSuggestions from './rules/eslint/suggestions.js';
|
|
12
|
+
import configImport from './rules/import.js';
|
|
13
|
+
import configJsdoc from './rules/jsdoc.js';
|
|
14
|
+
|
|
15
|
+
const compat = new FlatCompat();
|
|
16
|
+
|
|
17
|
+
/** @type {import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray} */
|
|
18
|
+
export default tseslint.config(
|
|
19
|
+
eslintJs.configs.recommended,
|
|
20
|
+
...compat.config({ extends: 'eslint-config-airbnb-base' }),
|
|
21
|
+
configEslintPossibleProblems,
|
|
22
|
+
configEslintSuggestions,
|
|
23
|
+
configEslintLayoutFormatting,
|
|
24
|
+
configImport,
|
|
25
|
+
...tseslint.configs.recommended,
|
|
26
|
+
pluginJsdoc.configs['flat/recommended'],
|
|
27
|
+
configJsdoc,
|
|
28
|
+
{
|
|
29
|
+
languageOptions: {
|
|
30
|
+
ecmaVersion: 'latest', // TODO: デフォルト値は latest だが、明示的に指定しないと Top-level await で Parsing error が発生する
|
|
31
|
+
parserOptions: {
|
|
32
|
+
project: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
plugins: {
|
|
36
|
+
pluginJsdoc,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
files: ['**/*.ts'],
|
|
41
|
+
languageOptions: {
|
|
42
|
+
parser: parserTypeScript,
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
...pluginTypeScript.configs['strict-type-checked'].rules,
|
|
46
|
+
...pluginTypeScript.configs['stylistic-type-checked'].rules,
|
|
47
|
+
...pluginJsdoc.configs['flat/recommended-typescript'].rules,
|
|
48
|
+
'dot-notation': 'off',
|
|
49
|
+
'@typescript-eslint/dot-notation': 'off',
|
|
50
|
+
'@typescript-eslint/no-extraneous-class': 'off',
|
|
51
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
52
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
53
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
54
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
55
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
56
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
57
|
+
'@typescript-eslint/strict-boolean-expressions': [
|
|
58
|
+
'error',
|
|
59
|
+
{
|
|
60
|
+
allowNullableBoolean: true,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
files: ['**/**.d.ts'],
|
|
67
|
+
rules: {
|
|
68
|
+
'no-use-before-define': 'off',
|
|
69
|
+
'no-var': 'off',
|
|
70
|
+
'vars-on-top': 'off',
|
|
71
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
files: ['**/**.test.ts', '**/**.test.js'],
|
|
76
|
+
rules: {
|
|
77
|
+
'no-new': 'off',
|
|
78
|
+
'no-tabs': 'off',
|
|
79
|
+
'no-unused-expressions': 'off',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
files: ['**/**.test.ts'],
|
|
84
|
+
rules: {
|
|
85
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
86
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
files: ['**/**.test.js'],
|
|
91
|
+
rules: {
|
|
92
|
+
'import/no-extraneous-dependencies': 'off',
|
|
93
|
+
'import/no-named-as-default': 'off',
|
|
94
|
+
'import/no-named-as-default-member': 'off',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w0s/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "ESLint configuration file used on w0s.jp",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -13,20 +13,26 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"rules"
|
|
15
15
|
],
|
|
16
|
-
"
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "eslint.config.js",
|
|
17
18
|
"repository": {
|
|
18
19
|
"type": "git",
|
|
19
20
|
"url": "git+https://github.com/SaekiTominaga/config.git"
|
|
20
21
|
},
|
|
21
22
|
"scripts": {
|
|
22
|
-
"test": "
|
|
23
|
+
"test": "node __tests__/index.test.js"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
27
|
+
"@eslint/js": "^8.57.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
29
|
+
"@typescript-eslint/parser": "^7.17.0",
|
|
26
30
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
27
|
-
"eslint-plugin-jsdoc": "^48.
|
|
31
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
32
|
+
"typescript-eslint": "^7.17.0"
|
|
28
33
|
},
|
|
29
34
|
"devDependencies": {
|
|
35
|
+
"@types/eslint": "^8.56.11",
|
|
30
36
|
"eslint": "^8.57.0"
|
|
31
37
|
},
|
|
32
38
|
"peerDependencies": {
|
package/rules/import.js
CHANGED
package/rules/jsdoc.js
CHANGED
package/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
'eslint:recommended',
|
|
4
|
-
'airbnb-base',
|
|
5
|
-
'./rules/eslint/possible-problems.js',
|
|
6
|
-
'./rules/eslint/suggestions.js',
|
|
7
|
-
'./rules/eslint/layout&formatting.js',
|
|
8
|
-
'./rules/import.js',
|
|
9
|
-
'plugin:jsdoc/recommended',
|
|
10
|
-
'./rules/jsdoc.js',
|
|
11
|
-
],
|
|
12
|
-
parserOptions: {
|
|
13
|
-
ecmaVersion: 2022,
|
|
14
|
-
sourceType: 'module',
|
|
15
|
-
project: true,
|
|
16
|
-
},
|
|
17
|
-
plugins: ['jsdoc'],
|
|
18
|
-
overrides: [
|
|
19
|
-
{
|
|
20
|
-
files: ['*.ts'],
|
|
21
|
-
extends: ['plugin:@typescript-eslint/strict-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked', 'plugin:jsdoc/recommended-typescript'],
|
|
22
|
-
rules: {
|
|
23
|
-
'dot-notation': 'off',
|
|
24
|
-
'@typescript-eslint/dot-notation': 'off',
|
|
25
|
-
'@typescript-eslint/no-extraneous-class': 'off',
|
|
26
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
27
|
-
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
28
|
-
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
29
|
-
'@typescript-eslint/no-unsafe-call': 'off',
|
|
30
|
-
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
31
|
-
'@typescript-eslint/no-unsafe-return': 'off',
|
|
32
|
-
'@typescript-eslint/strict-boolean-expressions': [
|
|
33
|
-
'error',
|
|
34
|
-
{
|
|
35
|
-
allowNullableBoolean: true,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
files: ['*.d.ts'],
|
|
42
|
-
rules: {
|
|
43
|
-
'no-use-before-define': 'off',
|
|
44
|
-
'no-var': 'off',
|
|
45
|
-
'vars-on-top': 'off',
|
|
46
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
files: ['*.test.ts', '*.test.js'],
|
|
51
|
-
rules: {
|
|
52
|
-
'no-new': 'off',
|
|
53
|
-
'no-tabs': 'off',
|
|
54
|
-
'no-unused-expressions': 'off',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
files: ['*.test.ts'],
|
|
59
|
-
rules: {
|
|
60
|
-
'@typescript-eslint/ban-ts-comment': 'off',
|
|
61
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
files: ['*.test.js'],
|
|
66
|
-
rules: {
|
|
67
|
-
'import/no-extraneous-dependencies': 'off',
|
|
68
|
-
'import/no-named-as-default': 'off',
|
|
69
|
-
'import/no-named-as-default-member': 'off',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
};
|