web: Set up eslint

This commit is contained in:
Jinny You 2023-11-28 14:03:02 +09:00 committed by Hermet Park
parent de01f861dd
commit 05fe9ec4a5
3 changed files with 1712 additions and 3 deletions

31
web/.eslintrc.js Normal file
View file

@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ["standard-with-typescript", "plugin:wc/best-practice"],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
semi: [2, "always"],
"@typescript-eslint/semi": "off",
},
settings: {
wc: {
elementBaseClasses: ["LitElement"],
},
},
};

View file

@ -4,7 +4,9 @@
"description": "A web lottie player using ThorVG as a renderer",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint ./src --ext .ts,.tsx,.js",
"lint:fix": "eslint ./src --ext .ts,.tsx,.js --fix"
},
"repository": {
"type": "git",
@ -23,6 +25,13 @@
"tvg"
],
"devDependencies": {
"typescript": "^5.3.2"
"@typescript-eslint/eslint-plugin": "^6.4.0",
"eslint": "^8.0.1",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-wc": "^2.0.4",
"typescript": "*"
}
}

File diff suppressed because it is too large Load diff