chore: add Stylelint

This commit is contained in:
MAZE 2023-10-05 16:47:45 +03:30
parent be2a66e207
commit 0e5948f058
5 changed files with 1349 additions and 5 deletions

3
.stylelintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/
dist/
.output/

22
.stylelintrc.json Normal file
View File

@ -0,0 +1,22 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-idiomatic-order",
"stylelint-config-html",
"stylelint-prettier/recommended"
],
"rules": {
"import-notation": "string",
"selector-class-pattern": null
},
"overrides": [
{
"files": ["*.astro"],
"rules": {
"prettier/prettier": null
}
}
]
}

View File

@ -7,10 +7,12 @@
"typescriptreact", "typescriptreact",
"astro" "astro"
], ],
"stylelint.validate": ["css", "html", "astro"],
"editor.defaultFormatter": "esbenp.prettier-vscode", "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true,
"source.fixAll.stylelint": true
}, },
"[javascript][javascriptreact][typescript][typescriptreact][astro]": { "[javascript][javascriptreact][typescript][typescriptreact][astro]": {
"editor.formatOnSave": false "editor.formatOnSave": false

1313
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,9 @@
"preview": "astro preview", "preview": "astro preview",
"astro": "astro", "astro": "astro",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.astro", "lint": "eslint . --ext .js,.jsx,.ts,.tsx,.astro",
"lint:fix": "npm run lint -- --fix" "lint:fix": "npm run lint -- --fix",
"lint:style": "stylelint ./**/*.{css,astro,html}",
"lint:style:fix": "npm run lint:style -- --fix"
}, },
"dependencies": { "dependencies": {
"@astrojs/react": "^3.0.3", "@astrojs/react": "^3.0.3",
@ -31,6 +33,12 @@
"eslint-plugin-react": "7.33.2", "eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-sort-destructure-keys": "1.5.0", "eslint-plugin-sort-destructure-keys": "1.5.0",
"eslint-plugin-sort-keys-fix": "1.1.2" "eslint-plugin-sort-keys-fix": "1.1.2",
"postcss-html": "1.5.0",
"stylelint": "15.10.3",
"stylelint-config-html": "1.1.0",
"stylelint-config-idiomatic-order": "9.0.0",
"stylelint-config-standard": "34.0.0",
"stylelint-prettier": "4.0.2"
} }
} }