mishig HF staff commited on
Commit
c8ac2fd
1 Parent(s): b52f201

Add eslint

Browse files
Files changed (4) hide show
  1. .eslintignore +13 -0
  2. .eslintrc.cjs +39 -0
  3. package-lock.json +0 -0
  4. package.json +7 -2
.eslintignore ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .DS_Store
2
+ node_modules
3
+ /build
4
+ /.svelte-kit
5
+ /package
6
+ .env
7
+ .env.*
8
+ !.env.example
9
+
10
+ # Ignore files for PNPM, NPM and YARN
11
+ pnpm-lock.yaml
12
+ package-lock.json
13
+ yarn.lock
.eslintrc.cjs ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ root: true,
3
+ parser: "@typescript-eslint/parser",
4
+ extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:svelte/recommended", "prettier"],
5
+ plugins: ["@typescript-eslint"],
6
+ ignorePatterns: ["*.cjs"],
7
+ overrides: [
8
+ {
9
+ files: ["*.svelte"],
10
+ parser: "svelte-eslint-parser",
11
+ parserOptions: {
12
+ parser: "@typescript-eslint/parser",
13
+ },
14
+ },
15
+ ],
16
+ parserOptions: {
17
+ sourceType: "module",
18
+ ecmaVersion: 2020,
19
+ extraFileExtensions: [".svelte"],
20
+ },
21
+ rules: {
22
+ "require-yield": "off",
23
+ "@typescript-eslint/no-explicit-any": "error",
24
+ "@typescript-eslint/no-non-null-assertion": "error",
25
+ "@typescript-eslint/no-unused-vars": [
26
+ // prevent variables with a _ prefix from being marked as unused
27
+ "error",
28
+ {
29
+ argsIgnorePattern: "^_",
30
+ },
31
+ ],
32
+ "object-shorthand": ["error", "always"],
33
+ },
34
+ env: {
35
+ browser: true,
36
+ es2017: true,
37
+ node: true,
38
+ },
39
+ };
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json CHANGED
@@ -8,15 +8,20 @@
8
  "preview": "vite preview",
9
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11
- "lint": "prettier --check .",
12
- "format": "prettier --write ."
13
  },
14
  "devDependencies": {
15
  "@sveltejs/adapter-auto": "^3.2.2",
16
  "@sveltejs/adapter-node": "^5.2.0",
17
  "@sveltejs/kit": "^2.0.0",
18
  "@sveltejs/vite-plugin-svelte": "^3.0.0",
 
 
19
  "autoprefixer": "^10.4.19",
 
 
 
20
  "highlight.js": "^11.10.0",
21
  "postcss": "^8.4.38",
22
  "prettier": "^3.1.1",
 
8
  "preview": "vite preview",
9
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11
+ "lint": "prettier --plugin-search-dir . --check . && eslint --ext .js,.ts,.svelte src/",
12
+ "format": "prettier --plugin-search-dir . --write ."
13
  },
14
  "devDependencies": {
15
  "@sveltejs/adapter-auto": "^3.2.2",
16
  "@sveltejs/adapter-node": "^5.2.0",
17
  "@sveltejs/kit": "^2.0.0",
18
  "@sveltejs/vite-plugin-svelte": "^3.0.0",
19
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
20
+ "@typescript-eslint/parser": "^6.21.0",
21
  "autoprefixer": "^10.4.19",
22
+ "eslint": "^8.57.1",
23
+ "eslint-config-prettier": "^8.10.0",
24
+ "eslint-plugin-svelte": "^2.44.0",
25
  "highlight.js": "^11.10.0",
26
  "postcss": "^8.4.38",
27
  "prettier": "^3.1.1",