Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 0008e5b

Browse files
committed
upgrading linting from eslint v8 to v9, get everything back working, and in vscode
1 parent 6d344d3 commit 0008e5b

414 files changed

Lines changed: 10927 additions & 20768 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUCK

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ pnpm_workspace(
106106
"//app/auth-portal:package.json",
107107
"//app/web:package.json",
108108
"//bin/auth-api:package.json",
109-
"//lib/eslint-config:package.json",
110109
"//lib/ts-lib:package.json",
111110
"//lib/tsconfig:package.json",
112111
"//lib/vue-lib:package.json",

app/auth-portal/.eslintrc.cjs

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

app/auth-portal/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import eslint from "@eslint/js";
2+
import pluginVue from "eslint-plugin-vue";
3+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
4+
5+
export default [
6+
eslint.configs.recommended,
7+
...pluginVue.configs["flat/recommended"],
8+
eslintPluginPrettierRecommended,
9+
];

app/auth-portal/BUCK

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ prod_deps_srcs = {
4646
}
4747

4848
dev_deps_srcs = {
49-
"lib/eslint-config": "//lib/eslint-config:src",
5049
"lib/tsconfig": "//lib/tsconfig:src",
5150
}
5251

@@ -60,7 +59,7 @@ vite_app(
6059

6160
eslint(
6261
name = "check-lint-typescript",
63-
srcs = [":src"] + glob([".eslint*"]),
62+
srcs = [":src"] + glob(["*eslint*"]),
6463
prod_deps_srcs = prod_deps_srcs,
6564
dev_deps_srcs = dev_deps_srcs,
6665
)

app/auth-portal/eslint.config.ts

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
import { globalIgnores } from "eslint/config";
2+
import {
3+
defineConfigWithVueTs,
4+
vueTsConfigs,
5+
} from "@vue/eslint-config-typescript";
6+
import pluginVue from "eslint-plugin-vue";
7+
import pluginVitest from "@vitest/eslint-plugin";
8+
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
9+
import importPlugin from "eslint-plugin-import";
10+
import tselint from "typescript-eslint";
11+
import vueParser from "vue-eslint-parser";
12+
import { fileURLToPath } from "url";
13+
import path from "path";
14+
15+
const __filename = fileURLToPath(import.meta.url);
16+
const __dirname = path.dirname(__filename);
17+
18+
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
19+
// import { configureVueProject } from '@vue/eslint-config-typescript'
20+
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
21+
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
22+
23+
export default defineConfigWithVueTs(
24+
{
25+
name: "app/files-to-lint",
26+
files: ["**/*.{vue,ts,mts,tsx}"],
27+
},
28+
29+
globalIgnores([
30+
"**/dist/**",
31+
"**/dist-ssr/**",
32+
"**/coverage/**",
33+
"eslint.config.ts",
34+
]),
35+
36+
...pluginVue.configs["flat/essential"],
37+
vueTsConfigs.recommended,
38+
importPlugin.flatConfigs["recommended"],
39+
tselint.configs["recommendedTypeChecked"],
40+
{
41+
languageOptions: {
42+
parser: vueParser,
43+
parserOptions: {
44+
parser: "@typescript-eslint/parser",
45+
// project: [`${__dirname}/tsconfig.json`],
46+
tsconfigRootDir: __dirname,
47+
// project: [`./tsconfig.json`, `./tsconfig.node.json`],
48+
// parserOptions: {
49+
// ecmaVersion: "latest",
50+
// sourceType: "module",
51+
// // project: ["./tsconfig.json", "./tsconfig.node.json"],
52+
// // TODO: figure our correct settings here
53+
// // project: [`${__dirname}/tsconfig.json`],
54+
// },
55+
},
56+
},
57+
},
58+
59+
{
60+
...pluginVitest.configs.recommended,
61+
files: ["src/**/__tests__/*"],
62+
},
63+
64+
skipFormatting,
65+
66+
{
67+
settings: {
68+
"import/resolver": {
69+
node: {
70+
extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
71+
},
72+
typescript: {
73+
// Optional: Specify the path to your tsconfig.json if it's not in the root
74+
project: "./tsconfig.json",
75+
},
76+
},
77+
},
78+
},
79+
80+
{
81+
rules: {
82+
// dont want this
83+
"@typescript-eslint/consistent-type-imports": 0,
84+
"import/named": 0,
85+
86+
// warning on this because we have some shenanigans where it is a promise but a literal `await` is not present
87+
"@typescript-eslint/require-await": "warn",
88+
89+
// "prettier/prettier": "warn",
90+
"@typescript-eslint/quotes": 0,
91+
92+
// this is currently breaking, so turning it off
93+
"@typescript-eslint/unbound-method": 0,
94+
95+
// some strict rules from TS / airbnb presets to relax -----------
96+
camelcase: "off",
97+
// "@typescript-eslint/ban-ts-comment": "off",
98+
// "import/prefer-default-export": 0,
99+
"no-plusplus": 0,
100+
radix: 0,
101+
"prefer-destructuring": 0,
102+
"no-else-return": 0, // sometimes clearer even though unnecessary
103+
"prefer-arrow-callback": 0,
104+
"arrow-body-style": 0,
105+
"@typescript-eslint/lines-between-class-members": 0, // often nice to group related one-liners
106+
"max-classes-per-file": 0, // can make sense to colocate small classes
107+
"consistent-return": 0, // often can make sense to return (undefined) early
108+
"no-useless-return": 0, // sometimes helps clarify you are bailing early
109+
"no-continue": 0,
110+
"no-underscore-dangle": 0,
111+
"no-await-in-loop": 0,
112+
"no-lonely-if": 0,
113+
"@typescript-eslint/no-unused-vars": [
114+
"warn",
115+
{
116+
argsIgnorePattern: "^_|^(response)$",
117+
varsIgnorePattern: "^_|^(props|emit)$",
118+
},
119+
],
120+
"@typescript-eslint/return-await": 0,
121+
122+
// other -----------------------------------------------------
123+
"no-undef": 0, // handled by typescript, which is better aware of global types
124+
// curly: ["error", "multi-line"],
125+
// "brace-style": "error",
126+
"max-len": [
127+
"warn", // just a warning since prettier will enforce
128+
120,
129+
2,
130+
{
131+
// bumped to 120, otherwise same as airbnb's rule but ignoring comments
132+
ignoreUrls: true,
133+
ignoreComments: true,
134+
ignoreRegExpLiterals: true,
135+
ignoreStrings: true,
136+
ignoreTemplateLiterals: true,
137+
},
138+
],
139+
"max-statements-per-line": ["error", { max: 1 }],
140+
// "@typescript-eslint/no-floating-promises": "error",
141+
142+
// custom plugin configs ------------------------------------------
143+
// make import/order understand our alias paths
144+
// "import/order": [
145+
// "warn",
146+
// {
147+
// pathGroups: [
148+
// {
149+
// pattern: "@/**",
150+
// group: "internal",
151+
// position: "after",
152+
// },
153+
// ],
154+
// pathGroupsExcludedImportTypes: ["internal", "external", "builtins"],
155+
// groups: [
156+
// "builtin",
157+
// "external",
158+
// "unknown",
159+
// "internal",
160+
// ["sibling", "parent"],
161+
// "index",
162+
// "object",
163+
// "type",
164+
// ],
165+
// },
166+
// ],
167+
168+
// rules to disable for now, but will likely be turned back on --------
169+
// TODO: review these rules, infractions case by case, probably turn back on?
170+
"@typescript-eslint/no-use-before-define": 0,
171+
// "import/no-cycle": 0,
172+
"no-param-reassign": 0,
173+
"no-restricted-syntax": 0,
174+
"@typescript-eslint/naming-convention": 0,
175+
"@typescript-eslint/no-shadow": 0,
176+
"guard-for-in": 0,
177+
178+
// some rules to downgrade to warning while developing --------------------
179+
// useful so things dont crash when code is temporarily commented out
180+
"no-console": "warn",
181+
"@typescript-eslint/no-empty-function": "warn",
182+
"no-debugger": "warn",
183+
"no-alert": "warn",
184+
"no-empty": "warn",
185+
186+
// good to warn people
187+
"@typescript-eslint/no-base-to-string": "warn",
188+
"@typescript-eslint/restrict-template-expressions": "warn",
189+
// dont want to error here because we often have async funcs used with other lib calls that dont await, but they do not have to await!
190+
"@typescript-eslint/no-misused-promises": "warn",
191+
192+
// turning this off, b/c our instances are actually for meaning & clarity
193+
"@typescript-eslint/no-redundant-type-constituents": 0,
194+
195+
// rules that we want to warn, but disable agressive auto-fixing -----------
196+
"prefer-const": 0,
197+
"no-unreachable": 0, // handy when you return early or throw an error while debugging
198+
// unreachable code will be removed by default, so we disable autofix, but leave a warning
199+
// "no-autofix/no-unreachable": 1,
200+
// useful while debugging and commenting things out, otherwise gets automatically changed from let to const
201+
// "no-autofix/prefer-const": "warn",
202+
203+
"vue/block-order": [
204+
"error",
205+
{
206+
order: [
207+
"template",
208+
"script[setup]",
209+
"script:not([setup])", // necessary for default exports to not get hoisted below imports in setup block
210+
"style:not([scoped])",
211+
"style[scoped]",
212+
],
213+
},
214+
],
215+
"vue/no-undef-components": [
216+
"error",
217+
{
218+
ignorePatterns: [
219+
"v-.*", // vue-konva requires global registration :( will hopefully fix soon!
220+
"router-(view|link)", // vue router is fairly standard to use via global registration
221+
],
222+
},
223+
],
224+
"vue/multi-word-component-names": "off",
225+
"vue/require-default-prop": "off",
226+
"vue/padding-line-between-blocks": "error",
227+
"vue/prefer-true-attribute-shorthand": "error",
228+
"vue/eqeqeq": "error",
229+
"vue/no-multiple-template-root": "error",
230+
231+
"vue/attribute-hyphenation": ["error", "never", { ignore: [] }],
232+
"vue/v-on-event-hyphenation": "off",
233+
234+
"@typescript-eslint/ban-ts-comment": 0,
235+
// skipping for now, but should re-enable
236+
"@typescript-eslint/no-floating-promises": 0,
237+
},
238+
},
239+
);

app/auth-portal/package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"build:analyze": "RUN_BUILD_ANALYZER=1 pnpm run build",
1212
"preview": "vite preview",
1313
"lint": "eslint src --ext .ts,.js,.cjs,.vue",
14-
"lint:strict": "pnpm run lint --max-warnings=0",
15-
"lint:fix": "pnpm run lint --fix",
14+
"lint:strict": "pnpm run lint --quiet",
15+
"lint:fix": "pnpm run lint --fix --quiet",
1616
"deploy": "pnpm run build && netlify deploy --dir=dist --prod",
1717
"test": "vitest --run",
1818
"test:validation": "vitest run src/lib/validations.test.ts"
@@ -36,21 +36,32 @@
3636
"vue-router": "^4.4.5"
3737
},
3838
"devDependencies": {
39-
"@si/eslint-config": "workspace:*",
4039
"@si/tsconfig": "workspace:*",
4140
"@types/lodash-es": "^4.17.12",
4241
"@types/node": "^18.19.59",
42+
"@typescript-eslint/eslint-plugin": "8.47.0",
43+
"@typescript-eslint/parser": "8.47.0",
4344
"@vitejs/plugin-vue": "^5.1.4",
44-
"eslint": "^8.57.1",
45+
"@vitest/eslint-plugin": "1.6.6",
46+
"@vue/eslint-config-prettier": "10.2.0",
47+
"@vue/eslint-config-typescript": "^14.6.0",
48+
"eslint": "^9.39.2",
49+
"eslint-config-prettier": "^8.5.0",
50+
"eslint-import-resolver-typescript": "^4.4.4",
51+
"eslint-plugin-import": "2.32.0",
52+
"eslint-plugin-vue": "^10.6.2",
4553
"netlify-cli": "^23.1.1",
54+
"prettier": "~2.8.4",
4655
"rollup-plugin-visualizer": "^5.12.0",
4756
"typescript": "^5.0.4",
57+
"typescript-eslint": "^8.53.0",
4858
"unplugin-icons": "^0.17.4",
4959
"vite": "^5.4.21",
50-
"vite-plugin-checker": "^0.6.4",
60+
"vite-plugin-checker": "^0.12.0",
5161
"vite-plugin-markdown": "^2.2.0",
5262
"vite-svg-loader": "^3.4.0",
5363
"vitest": "^3.2.4",
64+
"vue-eslint-parser": "^10.2.0",
5465
"vue-tsc": "^1.8.27"
5566
}
5667
}

app/auth-portal/src/pages/WorkspaceAuthTokensPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const listedTokens = computed(() => {
184184
return (
185185
_.reverse(
186186
_.sortBy(_.values(authTokens.state.value), "createdAt"),
187-
) as Array<AuthToken>
187+
)
188188
).map((token) => {
189189
const d = new Date(token.expiresAt as unknown as string);
190190
const isExpired = d.getTime() < now.value;

app/auth-portal/src/shims.d.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ declare module "*.md" {
99
// When "Mode.HTML" is requested
1010
const html: string;
1111

12-
// When "Mode.React" is requested. VFC could take a generic like React.VFC<{ MyComponent: TypeOfMyComponent }>
13-
import React from "react";
14-
15-
const ReactComponent: React.VFC;
16-
1712
// When "Mode.Vue" is requested
1813
import { ComponentOptions, Component } from "vue";
1914

@@ -23,12 +18,5 @@ declare module "*.md" {
2318
) => ComponentOptions;
2419

2520
// Modify below per your usage
26-
export {
27-
attributes,
28-
toc,
29-
html,
30-
ReactComponent,
31-
VueComponent,
32-
VueComponentWith,
33-
};
21+
export { attributes, toc, html, VueComponent, VueComponentWith };
3422
}

app/docs/eslint.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { globalIgnores } from "eslint/config";
2+
import {
3+
defineConfigWithVueTs,
4+
vueTsConfigs,
5+
} from "@vue/eslint-config-typescript";
6+
import pluginVue from "eslint-plugin-vue";
7+
import pluginVitest from "@vitest/eslint-plugin";
8+
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
9+
10+
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
11+
// import { configureVueProject } from '@vue/eslint-config-typescript'
12+
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
13+
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
14+
15+
export default defineConfigWithVueTs(
16+
{
17+
name: "app/files-to-lint",
18+
files: ["**/*.{vue,ts,mts,tsx}"],
19+
},
20+
21+
globalIgnores(["**/dist/**", "**/dist-ssr/**", "**/coverage/**"]),
22+
23+
...pluginVue.configs["flat/essential"],
24+
vueTsConfigs.recommended,
25+
26+
{
27+
...pluginVitest.configs.recommended,
28+
files: ["src/**/__tests__/*"],
29+
},
30+
31+
skipFormatting,
32+
);

0 commit comments

Comments
 (0)