pnpm add @reallyx/front-config -D
import { defineEslint } from "@reallyx/front-config";
export default defineEslint({
// ...configs
});
EslintConfig see configs
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
import { defineStyleLint } from "@reallyx/front-config";
export default defineStyleLint({
// ...configs
});
StylelintConfig see configs
For example:
{
"scripts": {
"stylelint": "stylelint \"**/*.{css,scss}\"",
"stylelint:fix": "stylelint \"**/*.{css,scss}\" --fix",
}
}
Install VS Code ESLint extension
Add the following settings to your settings.json
:
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false,
},
// eslint
"eslint.format.enable": true,
"eslint.useFlatConfig": true,
"eslint.validate": [
"vue",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"jsonc",
"json",
"json5",
"yaml",
"yml"
],
// stylelint
"stylelint.enable": true,
"stylelint.validate": [
"css",
"scss",
"sass",
"vue"
],
}