@w0s/eslint-config 9.2.0 → 9.3.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/README.md CHANGED
@@ -1,49 +1,50 @@
1
- # eslint-config
2
-
3
- [![npm version](https://badge.fury.io/js/%40w0s%2Feslint-config.svg)](https://www.npmjs.com/package/@w0s/eslint-config)
4
- [![Workflow status](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml/badge.svg)](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml)
5
-
6
- ESLint configuration file used on my personal website ([`w0s.jp`](https://github.com/SaekiTominaga/w0s.jp)).
7
-
8
- ## Base rules & plugins
9
-
10
- ### All files (Vanilla JavaScript, etc.)
11
-
12
- - [eslint:recommended](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-eslintrecommended)
13
- - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import):recommended
14
- - [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc):recommended
15
- - [eslint-plugin-safely-storage](https://github.com/SaekiTominaga/eslint-plugin/tree/main/packages/safely-storage)
16
- - and, some customizations
17
-
18
- ### TypeScript
19
-
20
- - [@typescript-eslint/eslint-plugin:strict-type-checked](https://typescript-eslint.io/users/configs/#strict-type-checked)
21
- - [@typescript-eslint/eslint-plugin:stylistic-type-checked](https://typescript-eslint.io/users/configs/#stylistic-type-checked)
22
- - [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc/):recommended-typescript
23
- - and, some customizations
24
-
25
- ## Usage
26
-
27
- ```javascript
28
- import w0sConfig from '@w0s/eslint-config';
29
-
30
- /** @type {import("eslint").Linter.Config[]} */
31
- export default [
32
- ...w0sConfig,
33
- {
34
- // other options
35
- },
36
- ];
37
- ```
38
-
39
- or
40
-
41
- ```javascript
42
- import { defineConfig } from 'eslint/config';
43
- import w0sConfig from '@w0s/eslint-config';
44
-
45
- /** @type {import("eslint").Linter.Config[]} */
46
- export default defineConfig(w0sConfig, {
47
- // other options
48
- });
49
- ```
1
+ # eslint-config
2
+
3
+ [![npm version](https://badge.fury.io/js/%40w0s%2Feslint-config.svg)](https://www.npmjs.com/package/@w0s/eslint-config)
4
+ [![Workflow status](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml/badge.svg)](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml)
5
+
6
+ ESLint configuration file used on my personal website ([`w0s.jp`](https://github.com/SaekiTominaga/w0s.jp)).
7
+
8
+ ## Base rules & plugins
9
+
10
+ ### All files (Vanilla JavaScript, etc.)
11
+
12
+ - [eslint](https://eslint.org/): recommended
13
+ - [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional): externalVanillaRecommended, recommended, stylistic
14
+ - [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import): recommended
15
+ - [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc): recommended
16
+ - [eslint-plugin-safely-storage](https://github.com/SaekiTominaga/eslint-plugin/tree/main/packages/safely-storage)
17
+ - and, some customizations
18
+
19
+ ### TypeScript
20
+
21
+ - [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/): strict-type-checked, stylistic-type-checked
22
+ - [eslint-plugin-functional](https://github.com/eslint-functional/eslint-plugin-functional): externalTypeScriptRecommended, recommended, stylistic
23
+ - [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc/): recommended-typescript
24
+ - and, some customizations
25
+
26
+ ## Usage
27
+
28
+ ```javascript
29
+ import w0sConfig from '@w0s/eslint-config';
30
+
31
+ /** @type {import("eslint").Linter.Config[]} */
32
+ export default [
33
+ ...w0sConfig,
34
+ {
35
+ // other options
36
+ },
37
+ ];
38
+ ```
39
+
40
+ or
41
+
42
+ ```javascript
43
+ import { defineConfig } from 'eslint/config';
44
+ import w0sConfig from '@w0s/eslint-config';
45
+
46
+ /** @type {import("eslint").Linter.Config[]} */
47
+ export default defineConfig(w0sConfig, {
48
+ // other options
49
+ });
50
+ ```
package/eslint.config.js CHANGED
@@ -1,97 +1,122 @@
1
- // @ts-check
2
-
3
- // eslint-disable-next-line import/no-unresolved
4
- import { defineConfig } from 'eslint/config';
5
- import pluginImport from 'eslint-plugin-import';
6
- import { jsdoc as pluginJsdoc } from 'eslint-plugin-jsdoc';
7
- import pluginSafelyStorage from 'eslint-plugin-safely-storage';
8
- import globals from 'globals';
9
- // eslint-disable-next-line import/no-unresolved
10
- import tseslint from 'typescript-eslint';
11
- import eslint from '@eslint/js';
12
- import configEslintLayoutFormatting from './rules/eslint/layout&formatting.js';
13
- import configEslintPossibleProblems from './rules/eslint/possible-problems.js';
14
- import configEslintSuggestions from './rules/eslint/suggestions.js';
15
- import configImport from './rules/import.js';
16
- import configJsdoc from './rules/jsdoc.js';
17
-
18
- export default defineConfig(
19
- eslint.configs.recommended,
20
- configEslintPossibleProblems,
21
- configEslintSuggestions,
22
- configEslintLayoutFormatting,
23
-
24
- /* Plugins */
25
- pluginImport.flatConfigs.recommended,
26
- configImport,
27
-
28
- pluginJsdoc({ config: 'flat/recommended' }),
29
- configJsdoc,
30
-
31
- pluginSafelyStorage.configs.default,
32
-
33
- {
34
- files: ['**/*.js'],
35
- languageOptions: {
36
- ecmaVersion: 'latest', // デフォルト値は 'latest' だが明示的な指定が必要
37
- globals: globals.nodeBuiltin,
38
- },
39
- },
40
- {
41
- files: ['**/*.ts'],
42
- languageOptions: {
43
- parserOptions: {
44
- project: true,
45
- },
46
- },
47
- extends: [tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, pluginJsdoc({ config: 'flat/recommended-typescript' })],
48
- rules: {
49
- 'dot-notation': 'off',
50
- 'no-unused-vars': 'off',
51
- 'import/extensions': [
52
- 'error',
53
- 'ignorePackages',
54
- {
55
- js: 'never',
56
- },
57
- ],
58
- 'import/no-unresolved': 'off',
59
- '@typescript-eslint/no-unused-vars': [
60
- 'error',
61
- {
62
- caughtErrors: 'none',
63
- },
64
- ],
65
- '@typescript-eslint/strict-boolean-expressions': [
66
- 'error',
67
- {
68
- allowNullableBoolean: true,
69
- allowNullableObject: false,
70
- allowNumber: false,
71
- allowString: false,
72
- },
73
- ],
74
- },
75
- },
76
- {
77
- files: ['**/*.config.js'],
78
- rules: {
79
- 'import/no-extraneous-dependencies': 'off',
80
- },
81
- },
82
- {
83
- files: ['**/*.test.js', '**/*.test.ts'],
84
- rules: {
85
- 'no-new': 'off',
86
- 'no-unused-expressions': 'off',
87
- 'import/no-extraneous-dependencies': 'off',
88
- },
89
- },
90
- {
91
- files: ['**/*.test.ts'],
92
- rules: {
93
- '@typescript-eslint/no-non-null-assertion': 'off',
94
- '@typescript-eslint/no-unnecessary-type-assertion': 'off',
95
- },
96
- },
97
- );
1
+ // @ts-check
2
+ /* eslint-disable import/no-unresolved */
3
+
4
+ import { defineConfig } from 'eslint/config';
5
+ import pluginFunctional from 'eslint-plugin-functional';
6
+ import pluginImport from 'eslint-plugin-import';
7
+ import { jsdoc as pluginJsdoc } from 'eslint-plugin-jsdoc';
8
+ import pluginSafelyStorage from 'eslint-plugin-safely-storage';
9
+ import globals from 'globals';
10
+ import tseslint from 'typescript-eslint';
11
+ import eslint from '@eslint/js';
12
+ import configEslintLayoutFormatting from './rules/eslint/layout&formatting.js';
13
+ import configEslintPossibleProblems from './rules/eslint/possible-problems.js';
14
+ import configEslintSuggestions from './rules/eslint/suggestions.js';
15
+ import configFunctional from './rules/functional.js';
16
+ import configImport from './rules/import.js';
17
+ import configJsdoc from './rules/jsdoc.js';
18
+
19
+ /** @type {import("eslint").Linter.Config[]} */
20
+ export default defineConfig(
21
+ eslint.configs.recommended,
22
+ configEslintPossibleProblems,
23
+ configEslintSuggestions,
24
+ configEslintLayoutFormatting,
25
+
26
+ /* Plugins */
27
+ pluginImport.flatConfigs.recommended,
28
+ configImport,
29
+
30
+ pluginJsdoc({ config: 'flat/recommended' }),
31
+ configJsdoc,
32
+
33
+ pluginSafelyStorage.configs.default,
34
+
35
+ {
36
+ files: ['**/*.js'],
37
+ languageOptions: {
38
+ ecmaVersion: 'latest', // デフォルト値は 'latest' だが明示的な指定が必要
39
+ globals: globals.nodeBuiltin,
40
+ },
41
+ extends: [
42
+ pluginFunctional.configs.externalVanillaRecommended,
43
+ pluginFunctional.configs.recommended,
44
+ pluginFunctional.configs.stylistic,
45
+ pluginFunctional.configs.disableTypeChecked,
46
+ ],
47
+ rules: {
48
+ ...configFunctional.rules,
49
+ },
50
+ },
51
+ {
52
+ files: ['**/*.ts'],
53
+ languageOptions: {
54
+ parserOptions: {
55
+ project: true,
56
+ },
57
+ },
58
+ extends: [
59
+ tseslint.configs.strictTypeChecked,
60
+ tseslint.configs.stylisticTypeChecked,
61
+ pluginFunctional.configs.externalTypeScriptRecommended,
62
+ pluginFunctional.configs.recommended,
63
+ pluginFunctional.configs.stylistic,
64
+ pluginJsdoc({ config: 'flat/recommended-typescript' }),
65
+ ],
66
+ rules: {
67
+ 'dot-notation': 'off',
68
+ 'no-unused-vars': 'off',
69
+ ...configFunctional.rules,
70
+ 'import/extensions': [
71
+ 'error',
72
+ 'ignorePackages',
73
+ {
74
+ js: 'never',
75
+ },
76
+ ],
77
+ 'import/no-unresolved': 'off',
78
+ '@typescript-eslint/no-unused-vars': [
79
+ 'error',
80
+ {
81
+ caughtErrors: 'none',
82
+ },
83
+ ],
84
+ '@typescript-eslint/strict-boolean-expressions': [
85
+ 'error',
86
+ {
87
+ allowNullableBoolean: true,
88
+ allowNullableObject: false,
89
+ allowNumber: false,
90
+ allowString: false,
91
+ },
92
+ ],
93
+ '@typescript-eslint/switch-exhaustiveness-check': [
94
+ 'error',
95
+ {
96
+ considerDefaultExhaustiveForUnions: true,
97
+ },
98
+ ], // eslint-plugin-functional; externalTypeScriptRecommended
99
+ },
100
+ },
101
+ {
102
+ files: ['**/*.config.js'],
103
+ rules: {
104
+ 'import/no-extraneous-dependencies': 'off',
105
+ },
106
+ },
107
+ {
108
+ files: ['**/*.test.js', '**/*.test.ts'],
109
+ rules: {
110
+ 'no-new': 'off',
111
+ 'no-unused-expressions': 'off',
112
+ 'import/no-extraneous-dependencies': 'off',
113
+ },
114
+ },
115
+ {
116
+ files: ['**/*.test.ts'],
117
+ rules: {
118
+ '@typescript-eslint/no-non-null-assertion': 'off',
119
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
120
+ },
121
+ },
122
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w0s/eslint-config",
3
- "version": "9.2.0",
3
+ "version": "9.3.0",
4
4
  "description": "ESLint configuration file used on `w0s.jp`",
5
5
  "keywords": [
6
6
  "eslint",
@@ -25,16 +25,17 @@
25
25
  "lint": "eslint __tests__/valid/**/*.{js,ts} __tests__/*.test.js rules/**/*.js eslint.config.js"
26
26
  },
27
27
  "dependencies": {
28
- "@eslint/js": "^9.37.0",
28
+ "@eslint/js": "^9.39.1",
29
+ "eslint-plugin-functional": "^9.0.2",
29
30
  "eslint-plugin-import": "^2.32.0",
30
- "eslint-plugin-jsdoc": "^60.8.3",
31
+ "eslint-plugin-jsdoc": "^61.2.1",
31
32
  "eslint-plugin-safely-storage": "^1.0.2",
32
33
  "globals": "^16.4.0",
33
- "typescript-eslint": "^8.46.0"
34
+ "typescript-eslint": "^8.46.4"
34
35
  },
35
36
  "devDependencies": {
36
- "@types/node": "^24.7.0",
37
- "eslint": "^9.37.0"
37
+ "@types/node": "^24.10.1",
38
+ "eslint": "^9.39.1"
38
39
  },
39
40
  "peerDependencies": {
40
41
  "eslint": "^9.35.0"
@@ -0,0 +1,55 @@
1
+ /* eslint-disable jsdoc/lines-before-block */
2
+
3
+ /** @type {import("eslint").Linter.Config} */
4
+ export default {
5
+ rules: {
6
+ /**
7
+ * Currying
8
+ */
9
+ 'functional/functional-parameters': [
10
+ 'error',
11
+ {
12
+ enforceParameterCount: false,
13
+ },
14
+ ] /* ☑️ ✅ 🔒 */,
15
+
16
+ /**
17
+ * No Exceptions
18
+ */
19
+ /* no-promise-reject */
20
+ 'functional/no-throw-statements': 'off' /* ☑️ ✅ 🔒 */,
21
+ /* 🔒 no-try-statements */
22
+
23
+ /**
24
+ * No Mutations
25
+ */
26
+ 'functional/immutable-data': 'off' /* ☑️ ✅ 🔒 */,
27
+ 'functional/no-let': 'off' /* ☑️ ✅ 🔒 */,
28
+ 'functional/prefer-immutable-types': 'off' /* ☑️ ✅ 🔒 */,
29
+ /* [❌ Deprecated] prefer-readonly-type */
30
+ /* ☑️ ✅ 🔒 type-declaration-immutability */
31
+
32
+ /**
33
+ * No Other Paradigms
34
+ */
35
+ 'functional/no-class-inheritance': 'off' /* ☑️ ✅ 🔒 */,
36
+ 'functional/no-classes': 'off' /* ✅ 🔒 */,
37
+ /* ☑️ ✅ 🔒 no-mixed-types */
38
+ /* 🔒 no-this-expressions */
39
+
40
+ /**
41
+ * No Statements
42
+ */
43
+ 'functional/no-conditional-statements': 'off' /* ✅ 🔒 */,
44
+ 'functional/no-expression-statements': 'off' /* ✅ 🔒 */,
45
+ /* ☑️ ✅ 🔒 no-loop-statements */
46
+ 'functional/no-return-void': 'off' /* ☑️ ✅ 🔒 */,
47
+
48
+ /**
49
+ * Stylistic
50
+ */
51
+ /* 🎨 prefer-property-signatures */
52
+ /* 🎨(⚠️) prefer-tacit */
53
+ /* 🎨 readonly-type */
54
+ },
55
+ };