File tree Expand file tree Collapse file tree 3 files changed +23
-20
lines changed Expand file tree Collapse file tree 3 files changed +23
-20
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ module.exports = (api, {
4646 }
4747 }
4848
49- if ( tsLint && ! api . hasPlugin ( 'eslint' ) ) {
49+ if ( tsLint ) {
5050 api . extendPackage ( {
5151 scripts : {
5252 lint : 'vue-cli-service lint'
@@ -114,13 +114,16 @@ module.exports = (api, {
114114 const jsRE = / \. j s $ /
115115 const excludeRE = / ^ t e s t \/ e 2 e \/ | \. c o n f i g \. j s $ /
116116 const convertLintFlags = require ( '../lib/convertLintFlags' )
117- const convertImports = require ( '../lib/convertImports' )
118117 api . postProcessFiles ( files => {
119118 for ( const file in files ) {
120119 if ( jsRE . test ( file ) && ! excludeRE . test ( file ) ) {
121120 const tsFile = file . replace ( jsRE , '.ts' )
122121 if ( ! files [ tsFile ] ) {
123- files [ tsFile ] = convertLintFlags ( convertImports ( files [ file ] ) )
122+ let content = files [ file ]
123+ if ( tsLint ) {
124+ content = convertLintFlags ( content )
125+ }
126+ files [ tsFile ] = content
124127 }
125128 delete files [ file ]
126129 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ module.exports = {
77 webpack : {
88 config : require . resolve ( '@vue/cli-service/webpack.config.js' )
99 }
10- }
10+ } ,
11+ 'import/extensions' : [
12+ '.js' ,
13+ '.jsx' ,
14+ '.mjs' ,
15+ '.ts' ,
16+ '.tsx'
17+ ]
18+ } ,
19+ rules : {
20+ 'import/extensions' : [ 'error' , 'always' , {
21+ js : 'never' ,
22+ mjs : 'never' ,
23+ jsx : 'never' ,
24+ ts : 'never' ,
25+ tsx : 'never'
26+ } ]
1127 }
1228}
You can’t perform that action at this time.
0 commit comments