Add ESLint configuration and switch to pnpm
This commit is contained in:
parent
baa5d413f5
commit
d266f7fa7f
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
src/meta/*
|
||||||
|
**/*.d.ts
|
||||||
|
**/*.d.ts.map
|
||||||
|
**/*.js
|
||||||
99
.eslintrc.json
Normal file
99
.eslintrc.json
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:vue/vue3-recommended",
|
||||||
|
"plugin:import/errors",
|
||||||
|
"plugin:import/warnings",
|
||||||
|
"plugin:import/typescript"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2021,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-var": "error",
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"double"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"comma-dangle": [
|
||||||
|
"error",
|
||||||
|
"never"
|
||||||
|
],
|
||||||
|
"import/order": [
|
||||||
|
"warn",
|
||||||
|
{
|
||||||
|
"newlines-between": "always",
|
||||||
|
"groups": [
|
||||||
|
[
|
||||||
|
"builtin",
|
||||||
|
"external"
|
||||||
|
],
|
||||||
|
"internal",
|
||||||
|
[
|
||||||
|
"parent",
|
||||||
|
"sibling",
|
||||||
|
"index"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"pathGroups": [
|
||||||
|
{
|
||||||
|
"pattern": "react",
|
||||||
|
"group": "external",
|
||||||
|
"position": "before"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pathGroupsExcludedImportTypes": [
|
||||||
|
"builtin"
|
||||||
|
],
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc",
|
||||||
|
"caseInsensitive": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"vue/script-indent": [
|
||||||
|
"error",
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
"baseIndent": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts",
|
||||||
|
"*.tsx"
|
||||||
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.vue"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.json",
|
||||||
|
"*.yaml",
|
||||||
|
"*.md"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1643
package-lock.json
generated
1643
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -106,10 +106,16 @@
|
|||||||
"@rollup/pluginutils": "^5.0.2",
|
"@rollup/pluginutils": "^5.0.2",
|
||||||
"@types/chrome": "^0.0.217",
|
"@types/chrome": "^0.0.217",
|
||||||
"@types/node": "^18.14.5",
|
"@types/node": "^18.14.5",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
||||||
"@violentmonkey/types": "^0.1.5",
|
"@violentmonkey/types": "^0.1.5",
|
||||||
"chrome-webstore-upload": "^1.0.0",
|
"chrome-webstore-upload": "^1.0.0",
|
||||||
|
"eslint": "^8.53.0",
|
||||||
|
"eslint-plugin-import": "^2.29.0",
|
||||||
|
"eslint-plugin-json": "^3.1.0",
|
||||||
|
"eslint-plugin-markdown": "^3.0.1",
|
||||||
|
"eslint-plugin-vue": "^9.18.1",
|
||||||
|
"eslint-plugin-yaml": "^0.5.0",
|
||||||
"esprima": "^4.0.1",
|
"esprima": "^4.0.1",
|
||||||
"eslint": "^8.0.1",
|
|
||||||
"jszip": "^3.10.0",
|
"jszip": "^3.10.0",
|
||||||
"lodash.template": "^4.5.0",
|
"lodash.template": "^4.5.0",
|
||||||
"markdown-it": "^12.3.2",
|
"markdown-it": "^12.3.2",
|
||||||
@ -141,6 +147,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node ./tools/rollup",
|
"build": "node ./tools/rollup",
|
||||||
"build:min": "node ./tools/rollup -min"
|
"build:min": "node ./tools/rollup -min",
|
||||||
|
"lint": "eslint --fix --ext .ts,.tsx src/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2752
pnpm-lock.yaml
generated
Normal file
2752
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"undef": true,
|
|
||||||
"unused": true,
|
|
||||||
"eqnull": true,
|
|
||||||
"expr": true,
|
|
||||||
"sub": true,
|
|
||||||
"scripturl": true,
|
|
||||||
"multistr": true,
|
|
||||||
"browser": true,
|
|
||||||
"devel": true,
|
|
||||||
"nonstandard": true,
|
|
||||||
"-W018": true,
|
|
||||||
"-W084": true,
|
|
||||||
"-W083": true,
|
|
||||||
"-W093": true,
|
|
||||||
"globals": {
|
|
||||||
"MediaError": false,
|
|
||||||
"Set": false,
|
|
||||||
"Promise": false,
|
|
||||||
"BroadcastChannel": false,
|
|
||||||
"GM_info": false,
|
|
||||||
"cloneInto": false,
|
|
||||||
"XPCNativeWrapper": false,
|
|
||||||
"unsafeWindow": false,
|
|
||||||
"chrome": false,
|
|
||||||
"GM": false<%=
|
|
||||||
meta.grants.filter(x => !/\./.test(x)).map(x => `,\n "${x}": false`).join('')
|
|
||||||
%><%=
|
|
||||||
read('/tmp/declaration.js').match(/^var (.*);/)[
|
|
||||||
1
|
|
||||||
].split(', ').map(x => `,\n "${x}": true`).join('')
|
|
||||||
%><%=
|
|
||||||
read('/src/globals/globals.js').match(/^var (.*);/)[
|
|
||||||
1
|
|
||||||
].split(', ').map(x => `,\n "${x}": true`).join('')
|
|
||||||
%>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user