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

chore: stylelint, ignores, and vscode settings #6601

Merged
merged 1 commit into from
Apr 15, 2024
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
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.js
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# dumi assets meta data
/assets.json

/.vscode/
/.idea/

# yarn https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
Expand Down
12 changes: 10 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
package.json
/pnpm-lock.yaml
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.js
*.min.css
10 changes: 10 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
coverage
dist
es
lib
node_modules
package-lock.json
pnpm-lock.yaml
yarn.lock
*.min.css
3 changes: 3 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'extends': ['stylelint-config-ali', 'stylelint-prettier/recommended'],
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint"
]
}
50 changes: 50 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"stylelint.validate": ["css", "scss", "less"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit",
"source.organizeImports": "explicit"
},
"editor.rulers": [80, 120],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"build": "gulp",
"build-doc": "dumi build && echo '!.*' > dist/.surgeignore",
"postinstall": "husky install",
"lint": "eslint .",
"lint:fix": "prettier --write . && eslint --fix .",
"lint": "eslint . && stylelint \"**/*.{css,less,scss}\"",
"lint:fix": "prettier --write . && eslint --fix . && stylelint --fix \"**/*.{css,less,scss}\"",
"package-diff": "antd-tools run package-diff --path=./lib",
"prepare": "husky install",
"pub": "npm run package-diff && npm publish ./lib",
Expand All @@ -47,7 +47,8 @@
},
"lint-staged": {
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": "eslint --fix",
"*.{cjs,css,cts,html,js,json,jsx,less,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}": "prettier --write"
"*.{cjs,css,cts,html,js,json,jsx,less,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}": "prettier --write",
"*.{css,less,scss}": "stylelint --fix"
},
"resolutions": {
"@types/react": "18",
Expand Down Expand Up @@ -158,6 +159,9 @@
"react-virtualized": "^9.22.5",
"size-limit": "^11.1.0",
"style-loader": "^3.3.2",
"stylelint": "^16.3.1",
"stylelint-config-ali": "^2.1.0",
"stylelint-prettier": "^5.0.0",
"through2": "^4.0.2",
"ts-jest": "^28.0.8",
"ts-node": "^10.9.1",
Expand Down
Loading
Loading