Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: stylelint v14 を peerDependencies から除外、v15 のルールに移行 #205

Merged
merged 2 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is intended to use for a project with styled-components.
## Install

```sh
yarn add --dev stylelint stylelint-config-prettier stylelint-config-standard stylelint-config-styled-components postcss-syntax postcss-jsx // install peerDependencies
yarn add --dev stylelint stylelint-config-standard stylelint-config-styled-components postcss-styled-syntax // install peerDependencies
yarn add --dev stylelint-config-smarthr
```

Expand Down
21 changes: 1 addition & 20 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,15 @@ module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-styled-components',
'stylelint-config-prettier'
],
customSyntax: 'postcss-jsx',
Copy link
Member Author

@f440 f440 May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. postcss-jsx が生まれる
  2. 更新が止まる
  3. stylelintがpostcss-css-in-jsとしてフォークする
  4. postcss-css-in-jsもアーカイブされ、乗り換えを促される

という流れを踏まえて変更しています。

customSyntax: 'postcss-styled-syntax',
rules: {
'value-keyword-case': null,
'property-case': 'lower',
'unit-case': 'lower',
'function-name-case': null,
'declaration-colon-space-before': 'never',
'declaration-colon-space-after': 'always-single-line',
'declaration-block-trailing-semicolon': 'always',
'declaration-block-semicolon-newline-after': 'always',
'declaration-empty-line-before': null,
'block-closing-brace-empty-line-before': 'never',
'block-closing-brace-newline-after': 'always',
'block-opening-brace-space-before': 'always',
'selector-attribute-brackets-space-inside': 'never',
'selector-attribute-operator-space-after': 'never',
'selector-attribute-operator-space-before': 'never',
'selector-attribute-quotes': 'always',
'selector-combinator-space-after': 'always',
'selector-combinator-space-before': 'always',
'string-quotes': 'single',
'font-family-name-quotes': 'always-where-required',
'value-list-comma-space-after': 'always',
'number-leading-zero': 'always',
'color-hex-length': 'short',
'color-hex-case': 'lower',
'no-descending-specificity': null,
'rule-empty-line-before': null,
'alpha-value-notation': 'number',
Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,18 @@
"@types/jest": "^29.5.1",
"@types/styled-components": "^5.1.26",
"jest": "^29.5.0",
"postcss-jsx": "^0.36.4",
"postcss-syntax": "^0.36.2",
"postcss-styled-syntax": "^0.4.0",
"standard-version": "^9.3.2",
"styled-components": "^5.3.10",
"stylelint": "^15.5.0",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^32.0.0",
"stylelint-config-styled-components": "^0.1.1"
"stylelint-config-styled-components": "^0.1.1",
"typescript": "^5.0.4"
},
"peerDependencies": {
"postcss-jsx": "^0.36.4",
"postcss-syntax": "^0.36.2",
"stylelint": "^14.9.1 || ^15.0.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^26.0.0 || ^28.0.0 || ^29.0.0 || ^30.0.0 || ^31.0.0 || ^32.0.0",
"postcss-styled-syntax": "^0.4.0",
"stylelint": "^15.5.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-config-styled-components": "^0.1.1"
}
}
55 changes: 0 additions & 55 deletions test/__snapshots__/run.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ exports[`fixtures should match the snapshot 1`] = `
"severity": "error",
"text": "Expected legacy color-function notation (color-function-notation)",
},
{
"rule": "color-hex-case",
"severity": "error",
"text": "Expected "#FFF" to be "#fff" (color-hex-case)",
},
{
"rule": "color-hex-length",
"severity": "error",
Expand All @@ -38,21 +33,6 @@ exports[`fixtures should match the snapshot 1`] = `
"severity": "error",
"text": "Expected shorthand property "flex" (declaration-block-no-redundant-longhand-properties)",
},
{
"rule": "declaration-block-trailing-semicolon",
"severity": "error",
"text": "Expected a trailing semicolon (declaration-block-trailing-semicolon)",
},
{
"rule": "declaration-colon-space-after",
"severity": "error",
"text": "Expected single space after ":" with a single-line declaration (declaration-colon-space-after)",
},
{
"rule": "declaration-colon-space-before",
"severity": "error",
"text": "Unexpected whitespace before ":" (declaration-colon-space-before)",
},
{
"rule": "font-family-name-quotes",
"severity": "error",
Expand All @@ -63,36 +43,11 @@ exports[`fixtures should match the snapshot 1`] = `
"severity": "error",
"text": "Unexpected unit (length-zero-no-unit)",
},
{
"rule": "number-leading-zero",
"severity": "error",
"text": "Expected a leading zero (number-leading-zero)",
},
{
"rule": "number-max-precision",
"severity": "error",
"text": "Expected "0.55555" to be "0.5555" (number-max-precision)",
},
{
"rule": "property-case",
"severity": "error",
"text": "Expected "Width" to be "width" (property-case)",
},
{
"rule": "selector-attribute-brackets-space-inside",
"severity": "error",
"text": "Unexpected whitespace after "[" (selector-attribute-brackets-space-inside)",
},
{
"rule": "selector-attribute-brackets-space-inside",
"severity": "error",
"text": "Unexpected whitespace before "]" (selector-attribute-brackets-space-inside)",
},
{
"rule": "selector-attribute-operator-space-after",
"severity": "error",
"text": "Unexpected whitespace after "=" (selector-attribute-operator-space-after)",
},
{
"rule": "selector-attribute-quotes",
"severity": "error",
Expand All @@ -108,16 +63,6 @@ exports[`fixtures should match the snapshot 1`] = `
"severity": "error",
"text": "Expected "0 0 0 0" to be "0" (shorthand-property-no-redundant-values)",
},
{
"rule": "string-quotes",
"severity": "error",
"text": "Expected single quotes (string-quotes)",
},
{
"rule": "unit-case",
"severity": "error",
"text": "Expected "PX" to be "px" (unit-case)",
},
],
}
`;
Loading