@w0s/eslint-config 6.0.0 → 6.0.2

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