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