@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.
@@ -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": "5.3.0",
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
- "main": "index.js",
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": "eslint __tests__/*"
23
+ "test": "node __tests__/index.test.js"
23
24
  },
24
25
  "dependencies": {
25
- "@typescript-eslint/eslint-plugin": "^7.7.1",
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.2.3"
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": {
@@ -1,4 +1,7 @@
1
- module.exports = {
1
+ // @ts-check
2
+
3
+ /** @type {import("eslint").Linter.FlatConfig} */
4
+ export default {
2
5
  rules: {
3
6
  'comma-dangle': ['error', 'always-multiline'],
4
7
  'function-paren-newline': 'off',
@@ -1,4 +1,7 @@
1
- module.exports = {
1
+ // @ts-check
2
+
3
+ /** @type {import("eslint").Linter.FlatConfig} */
4
+ export default {
2
5
  rules: {
3
6
  'no-await-in-loop': 'error',
4
7
  'no-irregular-whitespace': [
@@ -1,4 +1,7 @@
1
- module.exports = {
1
+ // @ts-check
2
+
3
+ /** @type {import("eslint").Linter.FlatConfig} */
4
+ export default {
2
5
  rules: {
3
6
  curly: 'error',
4
7
  eqeqeq: 'error',
package/rules/import.js CHANGED
@@ -1,4 +1,7 @@
1
- module.exports = {
1
+ // @ts-check
2
+
3
+ /** @type {import("eslint").Linter.FlatConfig} */
4
+ export default {
2
5
  rules: {
3
6
  'import/no-unresolved': 'off',
4
7
  'import/extensions': 'off',
package/rules/jsdoc.js CHANGED
@@ -1,4 +1,7 @@
1
- module.exports = {
1
+ // @ts-check
2
+
3
+ /** @type {import("eslint").Linter.FlatConfig} */
4
+ export default {
2
5
  rules: {
3
6
  'jsdoc/tag-lines': ['warn', 'any', { startLines: 1 }], // Recommended
4
7
  },
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
- };