Skip to content

Commit 6ba23ae

Browse files
authored
Merge pull request #12 from openreachtech/dev
Dev > Main as `1.0.0`
2 parents 194611f + b46913e commit 6ba23ae

16 files changed

+651
-3187
lines changed

README.ja.md

+39-103
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# eslint-rules-default
1+
# eslint-rules-default-jsdoc
22

33
## Language
44

@@ -7,7 +7,7 @@
77

88
## Overview
99

10-
此のパッケージは、ESLint の全ルールを明示されたディフォルトオプションと共に提供します。
10+
此のパッケージは、ESLint JSDoc plugin の全ルールを明示されたディフォルトオプションと共に提供します。
1111

1212
他の ESLint 構成リポジトリの基本ルールセットとして使用すると、すべてのルールが機能します。無効にしたいルールは、各ルールを明示的にオフにする必要があります。
1313

@@ -29,111 +29,46 @@ ESLint v9 以降と一緒に此のパッケージをインストールします
2929
```sh
3030
npm install --save-dev \
3131
eslint \
32-
@openreachtech/eslint-rules-default
32+
@openreachtech/eslint-rules-default-jsdoc
3333
```
3434

3535
### Configuring
3636

37-
`eslint.config.js` ファイルに、`@openreachtech/eslint-rules-default` をインポートし、それを使用するためのすべてのルールを含めます。
37+
`eslint.config.js` ファイルに、`@openreachtech/eslint-rules-default-jsdoc` をインポートし、それを使用するためのすべてのルールを含めます。
3838

3939
```js
4040
// eslint.config.js
41-
import ruleHash from '@openreachtech/eslint-rules-default'
41+
import jsdocPlugin from '@openreachtech/eslint-rules-default-jsdoc'
4242

4343
export default [
4444
{
45+
...jsdocPlugin,
46+
4547
rules: {
46-
...ruleHash.core.rules,
47-
...ruleHash.disableCoreStylistic.rules, // Not required after v10.
48+
...jsdocPlugin.rules,
4849

49-
indent: [
50-
'error',
51-
2, // 4
52-
],
53-
quotes: [
50+
'jsdoc/no-multi-asterisks': [
5451
'error',
55-
'single', // 'double'
5652
{
57-
avoidEscape: true,
58-
allowTemplateLiterals: false,
53+
allowWhitespace: false, // true
54+
preventAtEnd: true,
55+
preventAtMiddleLines: true,
5956
},
6057
],
61-
semi: [
58+
'jsdoc/tag-lines': [
6259
'error',
63-
'never', // 'always'
60+
'never',
6461
{
65-
beforeStatementContinuationChars: 'never', // 'any'
62+
count: 1,
63+
startLines: 1, // 0
64+
endLines: 0,
65+
applyToEndTag: true,
66+
tags: {},
6667
},
6768
],
68-
69-
...
70-
},
71-
},
72-
];
73-
```
74-
75-
#### Advanced Configuration
76-
77-
此のパッケージには、幾つかのプラグインのルールセットも含まれています。
78-
79-
1. [@stylistic/eslint-plugin](https://www.npmjs.com/package/@stylistic/eslint-plugin)
80-
2. [ESLint Jest plugin](https://www.npmjs.com/package/eslint-plugin-jest)
81-
3. [ESLint JSDoc plugin](https://www.npmjs.com/package/eslint-plugin-jsdoc)
82-
83-
`@stylistic/eslint-plugin` のルールセットで、現在のバージョンでは以下が含まれています。
84-
85-
| ルールセット | 含む |
86-
|--|:--:|
87-
| eslint-plugin-js ||
88-
| eslint-plugin-ts ||
89-
| eslint-plugin-jsx ||
90-
| eslint-plugin-plus ||
91-
92-
`ruleHash.stylisticTs``ruleHash.stylisticJsx` は、ニーズが多ければ将来追加されます。
93-
94-
#### Frequently-Disabled Rules
95-
96-
ESLint v9 のコア・ルールセットには、stylistic 関連のルールが含まれています。
97-
98-
ESLint v9 で `@stylistic/eslint-plugin` を使う場合は、以下の様にしてコア・ルールセット内の stylistic 関連のルールを無効化します。
99-
100-
```js
101-
// eslint.config.js
102-
import ruleHash from '@openreachtech/eslint-rules-default'
103-
104-
export default [
105-
// core rules
106-
{
107-
rules: {
108-
...ruleHash.core.rules,
109-
...ruleHash.disableCoreStylistic.rules,
110-
111-
indent: [
112-
'error',
113-
2, // 4
114-
],
115-
116-
...
11769
},
11870
},
119-
120-
// @stylistic rules
121-
{
122-
...ruleHash.stylisticJs,
123-
124-
rules: [
125-
...ruleHash.stylisticJs.rules,
126-
...ruleHash.stylisticPlus.rules,
127-
128-
'@stylistic/indent-binary-ops': [
129-
'error',
130-
4, // 2
131-
],
132-
133-
...
134-
],
135-
},
136-
];
71+
]
13772
```
13873

13974
## Track of Changes with Line Comments
@@ -142,37 +77,37 @@ export default [
14277

14378
```js
14479
// eslint.config.js
145-
import ruleHash from '@openreachtech/eslint-rules-default'
80+
import jsdocPlugin from '@openreachtech/eslint-rules-default-jsdoc'
14681

14782
export default [
14883
{
84+
...jsdocPlugin,
85+
14986
rules: {
150-
...ruleHash.core.rules,
151-
...ruleHash.disableCoreStylistic.rules,
87+
...jsdocPlugin.rules,
15288

153-
indent: [
154-
'error',
155-
2, // 4 <--- ✅
156-
],
157-
quotes: [
89+
'jsdoc/no-multi-asterisks': [
15890
'error',
159-
'single', // 'double' <--- ✅
16091
{
161-
avoidEscape: true,
162-
allowTemplateLiterals: false,
92+
allowWhitespace: false, // true <--- ✅
93+
preventAtEnd: true,
94+
preventAtMiddleLines: true,
16395
},
16496
],
165-
semi: [
97+
'jsdoc/tag-lines': [
16698
'error',
167-
'never', // 'always' <--- ✅
99+
'never',
168100
{
169-
beforeStatementContinuationChars: 'never', // 'any' <--- ✅
101+
count: 1,
102+
startLines: 1, // 0 <--- ✅
103+
endLines: 0,
104+
applyToEndTag: true,
105+
tags: {},
170106
},
171107
],
172-
...
173108
},
174109
},
175-
];
110+
]
176111
```
177112

178113
## License
@@ -190,9 +125,10 @@ GitHub Issues または Pull Request を通じてお気軽にご提案くださ
190125
私たちはユーザーの期待に応えるよう活動しており、貢献を高く評価します。
191126

192127
```sh
193-
% git clone https://github.com/openreachtech/eslint-rules-default.git
194-
% cd eslint-rules-default
128+
% git clone https://github.com/openreachtech/eslint-rules-default-jsdoc.git
129+
% cd eslint-rules-default-jsdoc
195130
% npm install
131+
% npm run lint
196132
% npm test
197133
```
198134

0 commit comments

Comments
 (0)