Skip to content

Commit 9fedb88

Browse files
authored
Merge pull request #104 from simonsobs/dev
Replace `.eslintrc.ts` with `eslint.config.ts`
2 parents 802c709 + 4cf3752 commit 9fedb88

File tree

5 files changed

+62
-24
lines changed

5 files changed

+62
-24
lines changed

.eslintrc.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

eslint.config.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import js from "@eslint/js";
2+
import * as tseslint from "typescript-eslint";
3+
import vuePlugin from "eslint-plugin-vue";
4+
import prettierPlugin from "eslint-plugin-prettier";
5+
import prettierConfig from "eslint-config-prettier";
6+
7+
const isProduction = import.meta.env?.PROD || process.env.NODE_ENV === "production";
8+
9+
export default [
10+
js.configs.recommended,
11+
...tseslint.configs.recommended,
12+
13+
// Vue configuration
14+
{
15+
files: ["**/*.vue"],
16+
plugins: {
17+
vue: vuePlugin,
18+
},
19+
languageOptions: {
20+
parser: "vue-eslint-parser",
21+
parserOptions: {
22+
parser: tseslint.parser,
23+
ecmaVersion: 2022,
24+
extraFileExtensions: [".vue"],
25+
sourceType: "module",
26+
},
27+
},
28+
rules: {
29+
...vuePlugin.configs.essential.rules,
30+
"vue/multi-word-component-names": "off",
31+
"vue/script-setup-uses-vars": "warn",
32+
"vue/no-unused-components": "off",
33+
},
34+
},
35+
36+
// Global configuration
37+
{
38+
languageOptions: {
39+
ecmaVersion: 2022,
40+
sourceType: "module",
41+
},
42+
plugins: {
43+
prettier: prettierPlugin,
44+
},
45+
rules: {
46+
"no-console": isProduction ? "warn" : "off",
47+
"no-debugger": isProduction ? "warn" : "off",
48+
"no-unused-vars": "off",
49+
"@typescript-eslint/no-var-requires": "off",
50+
"prettier/prettier": "warn",
51+
},
52+
},
53+
54+
prettierConfig, // Turn off rules that conflict with prettier
55+
];

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@graphql-codegen/typescript-operations": "^4.2.3",
3737
"@graphql-codegen/typescript-vue-urql": "^3.1.0",
3838
"@rollup/plugin-graphql": "^2.0.5",
39+
"@types/eslint-config-prettier": "^6.11.3",
3940
"@types/node": "~22.13.5",
4041
"@types/path-browserify": "^1.0.3",
4142
"@typescript-eslint/eslint-plugin": "^8.24.1",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
2222
},
2323
"include": [
24+
"eslint.config.ts",
2425
"src/**/*.ts",
2526
"src/**/*.tsx",
2627
"src/**/*.vue",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,11 @@
19161916
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
19171917
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
19181918

1919+
"@types/eslint-config-prettier@^6.11.3":
1920+
version "6.11.3"
1921+
resolved "https://registry.yarnpkg.com/@types/eslint-config-prettier/-/eslint-config-prettier-6.11.3.tgz#319f53eeb5a8b50e702fa081a9fe39bf01df8c1d"
1922+
integrity sha512-3wXCiM8croUnhg9LdtZUJQwNcQYGWxxdOWDjPe1ykCqJFPVpzAKfs/2dgSoCtAvdPeaponcWPI7mPcGGp9dkKQ==
1923+
19191924
"@types/estree@1.0.6", "@types/estree@^1.0.6":
19201925
version "1.0.6"
19211926
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"

0 commit comments

Comments
 (0)