Skip to content

Commit dea1902

Browse files
committed
fix: configure stylelint to lint styled-components files
Install postcss-styled-syntax and set it as the custom syntax in stylelint config. Update lint:css script to target *.styles.ts files instead of all JS/TS files.
1 parent e7da621 commit dea1902

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test:watch": "yarn test --watch",
2121
"test:coverage": "yarn test --coverage",
2222
"lint": "eslint './**/*.{js,jsx,ts,tsx}'",
23-
"lint:css": "stylelint './**/*.{js,jsx,ts,tsx}'",
23+
"lint:css": "stylelint './**/*.styles.ts'",
2424
"analyze": "BUNDLE_ANALYZE=true yarn build"
2525
},
2626
"dependencies": {
@@ -73,6 +73,7 @@
7373
"jest": "^29.7.0",
7474
"jest-environment-jsdom": "^29.7.0",
7575
"jest-fetch-mock": "^3.0.1",
76+
"postcss-styled-syntax": "^0.7.1",
7677
"react-test-renderer": "^18.0.0",
7778
"redis-mock": "^0.47.0",
7879
"redux-mock-store": "^1.5.4",

stylelint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ module.exports = {
22
extends: [
33
'stylelint-config-recommended',
44
],
5+
customSyntax: 'postcss-styled-syntax',
56
};

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,6 +3160,7 @@ __metadata:
31603160
next: "npm:^14.2.0"
31613161
next-redux-wrapper: "npm:^8.1.0"
31623162
nprogress: "npm:^0.2.0"
3163+
postcss-styled-syntax: "npm:^0.7.1"
31633164
quagga: "npm:^0.12.1"
31643165
react: "npm:^18.0.0"
31653166
react-dom: "npm:^18.0.0"
@@ -7516,6 +7517,17 @@ __metadata:
75167517
languageName: node
75177518
linkType: hard
75187519

7520+
"postcss-styled-syntax@npm:^0.7.1":
7521+
version: 0.7.1
7522+
resolution: "postcss-styled-syntax@npm:0.7.1"
7523+
dependencies:
7524+
typescript: "npm:^5.7.3"
7525+
peerDependencies:
7526+
postcss: ^8.5.1
7527+
checksum: 10c0/85339ca0c511c88cb46bd3e2cdc1bc7ff695960946b653f411939f06cb47bd3e4f2d47e580cf949e56978153c49b462702c9e71d598f1e38619569783e431073
7528+
languageName: node
7529+
linkType: hard
7530+
75197531
"postcss-value-parser@npm:^4.0.2":
75207532
version: 4.0.2
75217533
resolution: "postcss-value-parser@npm:4.0.2"

0 commit comments

Comments
 (0)