eslint-plugin-smarthr 0.2.17 → 0.2.19
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.19](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.2.18...v0.2.19) (2023-01-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* a11y-input-has-name-attributeの対象となるコンポーネントを追加(InputFile, CheckBox, ComboBox, DatePicker) ([ed14952](https://github.com/kufu/eslint-plugin-smarthr/commit/ed14952996902e9d2e4c7deb7b5107e7a57b41d6))
|
|
11
|
+
|
|
12
|
+
### [0.2.18](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.2.17...v0.2.18) (2023-01-15)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* redundant-name にignores オプションを追加 ([#53](https://github.com/kufu/eslint-plugin-smarthr/issues/53)) ([638ed8f](https://github.com/kufu/eslint-plugin-smarthr/commit/638ed8fe6aad0b246ff13630359b60eb34ec4012))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* ディレクトリの削除もれ対応 ([#52](https://github.com/kufu/eslint-plugin-smarthr/issues/52)) ([afefcae](https://github.com/kufu/eslint-plugin-smarthr/commit/afefcaef7dbd52daf6dac2c095d0c58c56cbbed5))
|
|
23
|
+
|
|
5
24
|
### [0.2.17](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.2.15...v0.2.17) (2023-01-12)
|
|
6
25
|
|
|
7
26
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
const { generateTagFormatter } = require('../../libs/format_styled_components');
|
|
2
2
|
|
|
3
3
|
const EXPECTED_NAMES = {
|
|
4
|
-
'RadioButton$': 'RadioButton$',
|
|
5
4
|
'(i|I)nput$': 'Input$',
|
|
6
5
|
'(t|T)extarea$': 'Textarea$',
|
|
7
6
|
'(s|S)elect$': 'Select$',
|
|
7
|
+
'InputFile$': 'InputFile$',
|
|
8
|
+
'RadioButton$': 'RadioButton$',
|
|
9
|
+
'Check(b|B)ox$': 'CheckBox$',
|
|
10
|
+
'Combo(b|B)ox$': 'ComboBox$',
|
|
11
|
+
'DatePicker$': 'DatePicker$',
|
|
8
12
|
}
|
|
9
13
|
const TARGET_TAG_NAME_REGEX = new RegExp(`(${Object.keys(EXPECTED_NAMES).join('|')})`)
|
|
10
14
|
const INPUT_NAME_REGEX = /^[a-zA-Z0-9_\[\]]+$/
|
|
@@ -53,6 +53,7 @@ const betterNames = {
|
|
|
53
53
|
'smarthr/redundant-name': [
|
|
54
54
|
'error', // 'warn', 'off'
|
|
55
55
|
{
|
|
56
|
+
ignores: [ '\.stories\.' ], // ファイルパスに対して正規表現として一致する場合はチェック対象外にする
|
|
56
57
|
type: { ignorekeywords, suffix: ['Props', 'Type'] },
|
|
57
58
|
file: { ignorekeywords, betternames },
|
|
58
59
|
// property: { ignorekeywords, allowedNames },
|
|
@@ -9,6 +9,7 @@ const COMMON_DEFAULT_CONFIG = {
|
|
|
9
9
|
IGNORE_KEYWORDS: ['redux', 'views', 'pages', 'parts'],
|
|
10
10
|
}
|
|
11
11
|
const DEFAULT_CONFIG = {
|
|
12
|
+
ignores: [],
|
|
12
13
|
type: {
|
|
13
14
|
IGNORE_KEYWORDS: [
|
|
14
15
|
'redux', 'views', 'pages', 'parts',
|
|
@@ -57,6 +58,7 @@ const SCHEMA = [
|
|
|
57
58
|
{
|
|
58
59
|
type: 'object',
|
|
59
60
|
properties: {
|
|
61
|
+
ignores: { type: 'array', items: { type: 'string' }, default: [] },
|
|
60
62
|
type: {
|
|
61
63
|
...DEFAULT_SCHEMA_PROPERTY,
|
|
62
64
|
suffix: { type: 'array', items: { type: 'string' } },
|
|
@@ -394,6 +396,11 @@ module.exports = {
|
|
|
394
396
|
|
|
395
397
|
const option = context.options[0]
|
|
396
398
|
let filename = context.getFilename()
|
|
399
|
+
|
|
400
|
+
if ((option.ignores || []).some((i) => !!filename.match(new RegExp(i)))) {
|
|
401
|
+
return {}
|
|
402
|
+
}
|
|
403
|
+
|
|
397
404
|
const keywords = uniq((() => {
|
|
398
405
|
const keywordMatcher = filename.match(new RegExp(`${rootPath}/(.+?)$`))
|
|
399
406
|
|
package/github/CODEOWNERS
DELETED