Add basic ESLint configuration

This commit is contained in:
Robin van der Linde 2023-07-27 13:03:27 +02:00
parent 7eeac66471
commit 8b88c9fba9
No known key found for this signature in database
GPG key ID: 53956B3252478F0D
5 changed files with 2090 additions and 402 deletions

1
.eslintignore Normal file
View file

@ -0,0 +1 @@
src/test.ts

23
.eslintrc.cjs Normal file
View file

@ -0,0 +1,23 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
],
plugins: ["@typescript-eslint"],
root: true,
}

View file

@ -1,10 +1,11 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"eamodio.gitlens",
"github.vscode-pull-request-github",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"editorconfig.editorconfig"
]
"recommendations": [
"esbenp.prettier-vscode",
"eamodio.gitlens",
"github.vscode-pull-request-github",
"svelte.svelte-vscode",
"bradlc.vscode-tailwindcss",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint"
]
}

2440
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,9 @@
"generate": "mkdir -p ./assets/generated; npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:translations; npm run reset:layeroverview; npm run generate:service-worker",
"generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -",
"prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh",
"lint": "npm run lint:prettier && npm run lint:eslint",
"lint:eslint": "eslint ./src",
"lint:prettier": "prettier --check '**/*.ts' '**/*.svelte'",
"format": "prettier --write '**/*.ts' '**/*.svelte'",
"clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm",
"clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|studio\\|theme\\|style_test\\|statistics\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)",
@ -123,9 +126,13 @@
"@types/prompt-sync": "^4.1.0",
"@types/wikidata-sdk": "^6.1.0",
"@types/xml2js": "^0.4.9",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"assert": "^2.0.0",
"chai": "^4.3.6",
"dependency-cruiser": "^10.4.0",
"eslint": "^8.45.0",
"eslint-plugin-svelte": "^2.32.2",
"fs": "0.0.1-security",
"node-html-parser": "^6.1.5",
"prettier": "^2.8.8",
@ -140,9 +147,7 @@
"ts-node": "^10.9.1",
"ts2json-schema": "^1.4.0",
"tslib": "^2.5.0",
"tslint": "^6.1.3",
"tslint-no-circular-imports": "^0.7.0",
"typescript": "^4.7.4",
"vite": "^4.0.5"
}
}
}