eslint-plugin-smarthr
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -5,2 +5,10 @@ # Changelog | ||
### [0.5.8](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.7...v0.5.8) (2024-04-09) | ||
### Features | ||
* a11y-prohibit-input-maxlength-attribute ([#135](https://github.com/kufu/eslint-plugin-smarthr/issues/135)) ([9f9d010](https://github.com/kufu/eslint-plugin-smarthr/commit/9f9d010e819d936fe5f55556a8f65e6485c552ce)) | ||
* best-practice-for-layouts に <Stack align="center"> を <Center> に置き換えることを促すチェックを追加 ([#133](https://github.com/kufu/eslint-plugin-smarthr/issues/133)) ([5835530](https://github.com/kufu/eslint-plugin-smarthr/commit/58355308bf9a5d18d2d731e699c54806af969ed9)) | ||
### [0.5.7](https://github.com/kufu/eslint-plugin-smarthr/compare/v0.5.6...v0.5.7) (2024-04-01) | ||
@@ -7,0 +15,0 @@ |
{ | ||
"name": "eslint-plugin-smarthr", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"author": "SmartHR", | ||
@@ -30,3 +30,4 @@ "license": "MIT", | ||
"jest": "^27.4.7", | ||
"standard-version": "^9.3.2" | ||
"standard-version": "^9.3.2", | ||
"typescript-eslint": "^7.5.0" | ||
}, | ||
@@ -33,0 +34,0 @@ "peerDependencies": { |
@@ -12,2 +12,3 @@ # eslint-plugin-smarthr | ||
- [a11y-numbered-text-within-ol](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-numbered-text-within-ol) | ||
- [a11y-prohibit-input-maxlength-attribute](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-prohibit-input-maxlength-attribute) | ||
- [a11y-prohibit-input-placeholder](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-prohibit-input-placeholder) | ||
@@ -14,0 +15,0 @@ - [a11y-prohibit-useless-sectioning-fragment](https://github.com/kufu/eslint-plugin-smarthr/tree/main/rules/a11y-prohibit-useless-sectioning-fragment) |
@@ -96,2 +96,5 @@ const JSON5 = require('json5') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -98,0 +101,0 @@ meta: { |
@@ -47,2 +47,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -49,0 +52,0 @@ meta: { |
@@ -84,2 +84,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components'); | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -86,0 +89,0 @@ meta: { |
@@ -65,2 +65,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -67,0 +70,0 @@ meta: { |
@@ -226,2 +226,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -228,0 +231,0 @@ meta: { |
@@ -51,2 +51,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -53,0 +56,0 @@ meta: { |
@@ -43,2 +43,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components'); | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -45,0 +48,0 @@ meta: { |
@@ -80,2 +80,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -82,0 +85,0 @@ meta: { |
@@ -56,2 +56,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -58,0 +61,0 @@ meta: { |
@@ -12,2 +12,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -14,0 +17,0 @@ meta: { |
@@ -37,2 +37,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -39,0 +42,0 @@ meta: { |
@@ -5,2 +5,5 @@ const TILDE_REGEX = /([~〜])/ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -7,0 +10,0 @@ meta: { |
@@ -18,2 +18,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -20,0 +23,0 @@ meta: { |
@@ -13,2 +13,5 @@ const { checkImportStyledComponents, getStyledComponentBaseName } = require('../../libs/format_styled_components') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -15,0 +18,0 @@ meta: { |
@@ -28,2 +28,5 @@ const MESSAGE_NEW_DATE = `'new Date(arg)' のように引数を一つだけ指定したDate instanceの生成は実行環境によって結果が異なるため、以下のいずれかの方法に変更してください | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -30,0 +33,0 @@ meta: { |
@@ -28,2 +28,3 @@ const { generateTagFormatter } = require('../../libs/format_styled_components') | ||
const findJustifyAttr = (a) => a.name?.name === 'justify' | ||
const findAlignAttr = (a) => a.name?.name === 'align' | ||
@@ -59,2 +60,5 @@ const searchChildren = (node) => { | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -85,2 +89,8 @@ meta: { | ||
const alignAttr = layoutType === 'Stack' ? node.attributes.find(findAlignAttr) : null | ||
if (alignAttr && FLEX_END_REGEX.test(alignAttr.value.value)) { | ||
return | ||
} | ||
if (searchChildren(children[0])) { | ||
@@ -90,3 +100,3 @@ context.report({ | ||
message: | ||
justifyAttr && justifyAttr.value.value === 'center' | ||
(justifyAttr && justifyAttr.value.value === 'center' || alignAttr && alignAttr.value.value === 'center') | ||
? `${nodeName} は smarthr-ui/${layoutType} ではなく smarthr-ui/Center でマークアップしてください` | ||
@@ -93,0 +103,0 @@ : `${nodeName}には子要素が一つしか無いため、${layoutType}でマークアップする意味がありません。 |
@@ -11,2 +11,5 @@ const { generateTagFormatter } = require('../../libs/format_styled_components'); | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -13,0 +16,0 @@ meta: { |
@@ -82,2 +82,5 @@ const path = require('path') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -84,0 +87,0 @@ meta: { |
@@ -16,2 +16,5 @@ const SCHEMA = [ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -18,0 +21,0 @@ meta: { |
@@ -11,2 +11,5 @@ const SCHEMA = [ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -13,0 +16,0 @@ meta: { |
@@ -36,2 +36,5 @@ const path = require('path') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -38,0 +41,0 @@ meta: { |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -2,0 +5,0 @@ meta: { |
@@ -12,2 +12,5 @@ const SCHEMA = [{ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -14,0 +17,0 @@ meta: { |
@@ -35,2 +35,5 @@ const path = require('path') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -37,0 +40,0 @@ meta: { |
@@ -29,2 +29,5 @@ const recursiveFetchName = (obj, chained = '') => { | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -31,0 +34,0 @@ meta: { |
@@ -86,2 +86,5 @@ const path = require('path') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -88,0 +91,0 @@ meta: { |
@@ -43,2 +43,5 @@ const SCHEMA = [ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -45,0 +48,0 @@ meta: { |
@@ -23,2 +23,5 @@ const SCHEMA = [{ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -25,0 +28,0 @@ meta: { |
@@ -35,2 +35,5 @@ const path = require('path') | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -37,0 +40,0 @@ meta: { |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @type {import('@typescript-eslint/utils').TSESLint.RuleModule<''>} | ||
*/ | ||
module.exports = { | ||
@@ -2,0 +5,0 @@ meta: { |
@@ -58,2 +58,4 @@ const rule = require('../rules/best-practice-for-layouts') | ||
{ code: `<HogeCluster justify="end">{a}</HogeCluster>` }, | ||
{ code: `<Stack align="flex-end">{a}</Stack>` }, | ||
{ code: `<HogeStack align="end">{a}</HogeStack>` }, | ||
], | ||
@@ -86,4 +88,5 @@ invalid: [ | ||
{ code: `<HogeCluster justify="center">{a}</HogeCluster>`, errors: [ { message: 'HogeCluster は smarthr-ui/Cluster ではなく smarthr-ui/Center でマークアップしてください' } ] }, | ||
{ code: `<HogeStack align="center">{a}</HogeStack>`, errors: [ { message: 'HogeStack は smarthr-ui/Stack ではなく smarthr-ui/Center でマークアップしてください' } ] }, | ||
] | ||
}) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395793
101
5732
34
4
1