add million lint in dev mode (#6162)
add million lint Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -85,3 +85,4 @@ venv
|
||||
|
||||
.vscode-test
|
||||
.biome/
|
||||
.million
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
TARGET_CC = "${pkgs.stdenv.cc}/bin/${pkgs.stdenv.cc.targetPrefix}cc";
|
||||
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
||||
ELECTRON_OVERRIDE_DIST_PATH = "${pkgs.electron}/bin/";
|
||||
ELECTRON_OVERRIDE_DIST_PATH = if pkgs.stdenv.isDarwin then "${pkgs.electron}/Applications" else "${pkgs.electron}/bin";
|
||||
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS = true;
|
||||
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = "${pkgs.playwright-driver.browsers}/chromium-1091/chrome-linux/chrome";
|
||||
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
|
||||
|
2150
package-lock.json
generated
2150
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,7 @@
|
||||
"@kittycad/lib": "2.0.28",
|
||||
"@lezer/highlight": "^1.2.1",
|
||||
"@lezer/lr": "^1.4.1",
|
||||
"@million/lint": "^1.0.14",
|
||||
"@react-hook/resize-observer": "^2.0.1",
|
||||
"@replit/codemirror-interact": "^6.3.1",
|
||||
"@ts-stack/markdown": "^1.5.0",
|
||||
|
153
vite.config.ts
153
vite.config.ts
@ -6,85 +6,90 @@ import version from 'vite-plugin-package-version'
|
||||
import topLevelAwait from 'vite-plugin-top-level-await'
|
||||
import viteTsconfigPaths from 'vite-tsconfig-paths'
|
||||
import { configDefaults, defineConfig } from 'vitest/config'
|
||||
import MillionLint from '@million/lint'
|
||||
|
||||
const config = defineConfig({
|
||||
server: {
|
||||
open: true,
|
||||
port: 3000,
|
||||
watch: {
|
||||
ignored: [
|
||||
'**/target/**',
|
||||
'**/dist/**',
|
||||
'**/build/**',
|
||||
'**/test-results/**',
|
||||
'**/playwright-report/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
pool: 'forks',
|
||||
poolOptions: {
|
||||
forks: {
|
||||
maxForks: 2,
|
||||
minForks: 1,
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const runMillion = process.env.RUN_MILLION
|
||||
|
||||
return {
|
||||
server: {
|
||||
open: true,
|
||||
port: 3000,
|
||||
watch: {
|
||||
ignored: [
|
||||
'**/target/**',
|
||||
'**/dist/**',
|
||||
'**/build/**',
|
||||
'**/test-results/**',
|
||||
'**/playwright-report/**',
|
||||
],
|
||||
},
|
||||
},
|
||||
setupFiles: ['src/setupTests.ts', '@vitest/web-worker'],
|
||||
environment: 'happy-dom',
|
||||
coverage: {
|
||||
provider: 'istanbul', // or 'v8'
|
||||
},
|
||||
exclude: [...configDefaults.exclude, '**/e2e/**/*.spec.*', 'rust'],
|
||||
deps: {
|
||||
optimizer: {
|
||||
web: {
|
||||
include: ['vitest-canvas-mock'],
|
||||
test: {
|
||||
globals: true,
|
||||
pool: 'forks',
|
||||
poolOptions: {
|
||||
forks: {
|
||||
maxForks: 2,
|
||||
minForks: 1,
|
||||
},
|
||||
},
|
||||
setupFiles: ['src/setupTests.ts', '@vitest/web-worker'],
|
||||
environment: 'happy-dom',
|
||||
coverage: {
|
||||
provider: 'istanbul', // or 'v8'
|
||||
},
|
||||
exclude: [...configDefaults.exclude, '**/e2e/**/*.spec.*', 'rust'],
|
||||
deps: {
|
||||
optimizer: {
|
||||
web: {
|
||||
include: ['vitest-canvas-mock'],
|
||||
},
|
||||
},
|
||||
},
|
||||
clearMocks: true,
|
||||
restoreMocks: true,
|
||||
mockReset: true,
|
||||
reporters: process.env.GITHUB_ACTIONS
|
||||
? ['dot', 'github-actions']
|
||||
: // Gotcha: 'hanging-process' is very noisey, turn off by default on localhost
|
||||
// : ['verbose', 'hanging-process'],
|
||||
['verbose'],
|
||||
testTimeout: 1000,
|
||||
hookTimeout: 1000,
|
||||
teardownTimeout: 1000,
|
||||
},
|
||||
clearMocks: true,
|
||||
restoreMocks: true,
|
||||
mockReset: true,
|
||||
reporters: process.env.GITHUB_ACTIONS
|
||||
? ['dot', 'github-actions']
|
||||
: // Gotcha: 'hanging-process' is very noisey, turn off by default on localhost
|
||||
// : ['verbose', 'hanging-process'],
|
||||
['verbose'],
|
||||
testTimeout: 1000,
|
||||
hookTimeout: 1000,
|
||||
teardownTimeout: 1000,
|
||||
},
|
||||
build: {
|
||||
outDir: 'build',
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@kittycad/codemirror-lsp-client': '/packages/codemirror-lsp-client/src',
|
||||
'@kittycad/codemirror-lang-kcl': '/packages/codemirror-lang-kcl/src',
|
||||
'@rust': '/rust',
|
||||
'@e2e': '/e2e',
|
||||
'@src': '/src',
|
||||
'@public': '/public',
|
||||
'@root': '/',
|
||||
build: {
|
||||
outDir: 'build',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
viteTsconfigPaths(),
|
||||
eslint(),
|
||||
version(),
|
||||
lezer(),
|
||||
topLevelAwait({
|
||||
// The export name of top-level await promise for each chunk module
|
||||
promiseExportName: '__tla',
|
||||
// The function to generate import names of top-level await promise in each chunk module
|
||||
promiseImportName: (i) => `__tla_${i}`,
|
||||
}),
|
||||
],
|
||||
worker: {
|
||||
plugins: () => [viteTsconfigPaths()],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@kittycad/codemirror-lsp-client':
|
||||
'/packages/codemirror-lsp-client/src',
|
||||
'@kittycad/codemirror-lang-kcl': '/packages/codemirror-lang-kcl/src',
|
||||
'@rust': '/rust',
|
||||
'@e2e': '/e2e',
|
||||
'@src': '/src',
|
||||
'@public': '/public',
|
||||
'@root': '/',
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
viteTsconfigPaths(),
|
||||
eslint(),
|
||||
version(),
|
||||
lezer(),
|
||||
topLevelAwait({
|
||||
// The export name of top-level await promise for each chunk module
|
||||
promiseExportName: '__tla',
|
||||
// The function to generate import names of top-level await promise in each chunk module
|
||||
promiseImportName: (i) => `__tla_${i}`,
|
||||
}),
|
||||
runMillion && MillionLint.vite(),
|
||||
],
|
||||
worker: {
|
||||
plugins: () => [viteTsconfigPaths()],
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
export default config
|
||||
|
Reference in New Issue
Block a user