feat: Уставновлен плагин для соблюдения стилизации кода в файлах стилей

This commit is contained in:
Ilia Mashkov
2025-11-24 12:21:04 +03:00
parent 7c94fa8ffe
commit d3343f1f7b
3 changed files with 31 additions and 1 deletions

View File

@@ -40,6 +40,7 @@
"@storybook/addon-webpack5-compiler-babel": "^4.0.0", "@storybook/addon-webpack5-compiler-babel": "^4.0.0",
"@storybook/react": "^8.6.14", "@storybook/react": "^8.6.14",
"@storybook/react-webpack5": "^8.6.14", "@storybook/react-webpack5": "^8.6.14",
"@stylistic/stylelint-plugin": "^4.0.0",
"@svgr/webpack": "^8.1.0", "@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0", "@testing-library/react": "^16.3.0",

25
pnpm-lock.yaml generated
View File

@@ -63,6 +63,9 @@ importers:
'@storybook/react-webpack5': '@storybook/react-webpack5':
specifier: ^8.6.14 specifier: ^8.6.14
version: 8.6.14(@storybook/test@8.6.14(storybook@8.6.14(prettier@3.6.2)))(esbuild@0.25.12)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@8.6.14(prettier@3.6.2))(typescript@5.9.3)(webpack-cli@5.1.4) version: 8.6.14(@storybook/test@8.6.14(storybook@8.6.14(prettier@3.6.2)))(esbuild@0.25.12)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(storybook@8.6.14(prettier@3.6.2))(typescript@5.9.3)(webpack-cli@5.1.4)
'@stylistic/stylelint-plugin':
specifier: ^4.0.0
version: 4.0.0(stylelint@16.25.0(typescript@5.9.3))
'@svgr/webpack': '@svgr/webpack':
specifier: ^8.1.0 specifier: ^8.1.0
version: 8.1.0(typescript@5.9.3) version: 8.1.0(typescript@5.9.3)
@@ -1664,6 +1667,12 @@ packages:
peerDependencies: peerDependencies:
storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0
'@stylistic/stylelint-plugin@4.0.0':
resolution: {integrity: sha512-CFwt3K4Y/7bygNCLCQ8Sy4Hzgbhxq3BsNW0FIuYxl17HD3ywptm54ocyeiLVRrk5jtz1Zwks7Xr9eiZt8SWHAw==}
engines: {node: ^18.12 || >=20.9}
peerDependencies:
stylelint: ^16.22.0
'@svgr/babel-plugin-add-jsx-attribute@8.0.0': '@svgr/babel-plugin-add-jsx-attribute@8.0.0':
resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==} resolution: {integrity: sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==}
engines: {node: '>=14'} engines: {node: '>=14'}
@@ -5224,6 +5233,9 @@ packages:
peerDependencies: peerDependencies:
webpack: ^5.27.0 webpack: ^5.27.0
style-search@0.1.0:
resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==}
stylelint-config-recommended-scss@14.1.0: stylelint-config-recommended-scss@14.1.0:
resolution: {integrity: sha512-bhaMhh1u5dQqSsf6ri2GVWWQW5iUjBYgcHkh7SgDDn92ijoItC/cfO/W+fpXshgTQWhwFkP1rVcewcv4jaftRg==} resolution: {integrity: sha512-bhaMhh1u5dQqSsf6ri2GVWWQW5iUjBYgcHkh7SgDDn92ijoItC/cfO/W+fpXshgTQWhwFkP1rVcewcv4jaftRg==}
engines: {node: '>=18.12.0'} engines: {node: '>=18.12.0'}
@@ -7531,6 +7543,17 @@ snapshots:
dependencies: dependencies:
storybook: 8.6.14(prettier@3.6.2) storybook: 8.6.14(prettier@3.6.2)
'@stylistic/stylelint-plugin@4.0.0(stylelint@16.25.0(typescript@5.9.3))':
dependencies:
'@csstools/css-parser-algorithms': 3.0.5(@csstools/css-tokenizer@3.0.4)
'@csstools/css-tokenizer': 3.0.4
'@csstools/media-query-list-parser': 4.0.3(@csstools/css-parser-algorithms@3.0.5(@csstools/css-tokenizer@3.0.4))(@csstools/css-tokenizer@3.0.4)
postcss: 8.5.6
postcss-selector-parser: 7.1.0
postcss-value-parser: 4.2.0
style-search: 0.1.0
stylelint: 16.25.0(typescript@5.9.3)
'@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.5)': '@svgr/babel-plugin-add-jsx-attribute@8.0.0(@babel/core@7.28.5)':
dependencies: dependencies:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
@@ -11617,6 +11640,8 @@ snapshots:
dependencies: dependencies:
webpack: 5.103.0(esbuild@0.25.12)(webpack-cli@5.1.4) webpack: 5.103.0(esbuild@0.25.12)(webpack-cli@5.1.4)
style-search@0.1.0: {}
stylelint-config-recommended-scss@14.1.0(postcss@8.5.6)(stylelint@16.25.0(typescript@5.9.3)): stylelint-config-recommended-scss@14.1.0(postcss@8.5.6)(stylelint@16.25.0(typescript@5.9.3)):
dependencies: dependencies:
postcss-scss: 4.0.9(postcss@8.5.6) postcss-scss: 4.0.9(postcss@8.5.6)

View File

@@ -46,8 +46,12 @@ const {
module.exports = { module.exports = {
extends: 'stylelint-config-standard-scss', extends: 'stylelint-config-standard-scss',
plugins: ['stylelint-order'], plugins: [
'stylelint-order',
'@stylistic/stylelint-plugin',
],
rules: { rules: {
'@stylistic/indentation': 2,
'selector-class-pattern': null, 'selector-class-pattern': null,
'order/order': selectorOrdering, 'order/order': selectorOrdering,
'order/properties-order': propertyOrdering, 'order/properties-order': propertyOrdering,