File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 4343 },
4444 "scripts" : {
4545 "start" : " vite" ,
46+ "start:lint" : " vite --config vite.config-lint.ts" ,
4647 "start:open" : " vite --open" ,
4748 "build" : " tsc && vite build" ,
4849 "serve" : " vite preview" ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) 2024, RTE (http://www.rte-france.com)
3+ * This Source Code Form is subject to the terms of the Mozilla Public
4+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+ */
7+
8+ import { defineConfig , mergeConfig } from 'vite' ;
9+ import defaultConfig from './vite.config.ts' ;
10+ import react from '@vitejs/plugin-react' ;
11+ // @ts -expect-error See https://github.com/gxmari007/vite-plugin-eslint/issues/79
12+ import eslint from 'vite-plugin-eslint' ;
13+ import svgr from 'vite-plugin-svgr' ;
14+ import tsconfigPaths from 'vite-tsconfig-paths' ;
15+
16+ export default defineConfig ( ( configEnv ) => {
17+ const baseConfig = defaultConfig ( configEnv ) ;
18+ baseConfig . plugins = [ ] ; // remove existing plugins
19+ return mergeConfig ( baseConfig , {
20+ plugins : [
21+ react ( ) ,
22+ eslint ( {
23+ failOnWarning : true ,
24+ lintOnStart : true ,
25+ } ) ,
26+ svgr ( ) , // works on every import with the pattern "**/*.svg?react"
27+ tsconfigPaths ( ) , // to resolve absolute path via tsconfig cf https://stackoverflow.com/a/68250175/5092999
28+ ] ,
29+ } ) ;
30+ } ) ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default defineConfig((config) => ({
3333 react ( ) ,
3434 eslint ( {
3535 failOnWarning : config . mode !== 'development' ,
36- lintOnStart : true ,
36+ lintOnStart : false ,
3737 } ) ,
3838 svgr ( ) , // works on every import with the pattern "**/*.svg?react"
3939 tsconfigPaths ( ) , // to resolve absolute path via tsconfig cf https://stackoverflow.com/a/68250175/5092999
You can’t perform that action at this time.
0 commit comments