Skip to content

Commit

Permalink
Update Eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
hieu-w committed Aug 13, 2024
1 parent 11d984f commit cb59be9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 45 deletions.
20 changes: 17 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: ["@toruslabs/eslint-config-typescript"],
parser: "@typescript-eslint/parser",
extends: ["@toruslabs/vue"],
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaVersion: 11,
ecmaVersion: 2022,
project: "./tsconfig.json",
},
ignorePatterns: ["*.config.js", "*.d.ts", ".eslintrc.js"],
Expand All @@ -16,4 +17,17 @@ module.exports = {
node: true,
mocha: true,
},
rules: {
camelcase: 0,
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never",
},
],
}
};
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
Expand Down
45 changes: 8 additions & 37 deletions demo/vue-app-new/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,20 @@ module.exports = {
root: true,
extends: ["@toruslabs/vue"],
parser: "vue-eslint-parser",
ignorePatterns: ["*.config.js", ".eslintrc.js"],
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2022,
sourceType: "module",
ecmaVersion: 2022,
project: "./tsconfig.json",
},
ignorePatterns: ["*.cjs", "*.config.js", "vite.config.ts", "importLocales.js", "__generated__", ".eslintrc.js", "crisp.js"],
env: {
browser: true,
node: true,
mocha: true,
},
rules: {
"no-console": 0,
"vuejs-accessibility/form-control-has-label": 0,
"@typescript-eslint/no-explicit-any": 1,
"import/order": 0,
"class-methods-use-this": 0,
camelcase: 0,
"vue/multi-word-component-names": 0,
"@typescript-eslint/naming-convention": [
"error",
{
selector: "typeLike",
format: ["camelCase", "UPPER_CASE", "PascalCase"],
},
],
"mocha/no-global-tests": ["off"],
"prettier/prettier": [
2,
{
singleQuote: false,
printWidth: 150,
semi: true,
trailingComma: "es5",
},
],
"import/extensions": [
"error",
"ignorePackages",
Expand All @@ -46,16 +28,5 @@ module.exports = {
tsx: "never",
},
],
"no-underscore-dangle": 0,
"no-restricted-exports": 0,
"no-param-reassign": [2, { props: false }],
"vue/v-on-event-hyphenation": 0,
},
settings: {
"import/resolver": {
typescript: {
project: "./tsconfig.json",
},
},
},
};
};
6 changes: 1 addition & 5 deletions demo/vue-app-new/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
"scripthost"
]
},
"include": [
"src/*.vue",
"src/*.ts",
"src/*.tsx"
],
"include": ["src"],
"exclude": [
"node_modules"
]
Expand Down

0 comments on commit cb59be9

Please sign in to comment.