File tree Expand file tree Collapse file tree
packages/typescript-estree/src/create-program
tests/integration/fixtures/vue-sfc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -194,7 +194,6 @@ function getProgramsForProjects(
194194 results . push ( program ) ;
195195 }
196196
197- parsedFilesSeen . add ( filePath ) ;
198197 return results ;
199198}
200199
@@ -216,11 +215,13 @@ function createWatchProgram(
216215
217216 // ensure readFile reads the code being linted instead of the copy on disk
218217 const oldReadFile = watchCompilerHost . readFile ;
219- watchCompilerHost . readFile = ( filePath , encoding ) : string | undefined =>
220- path . normalize ( filePath ) ===
221- path . normalize ( currentLintOperationState . filePath )
218+ watchCompilerHost . readFile = ( filePath , encoding ) : string | undefined => {
219+ parsedFilesSeen . add ( filePath ) ;
220+ return path . normalize ( filePath ) ===
221+ path . normalize ( currentLintOperationState . filePath )
222222 ? currentLintOperationState . code
223223 : oldReadFile ( filePath , encoding ) ;
224+ } ;
224225
225226 // ensure process reports error on failure instead of exiting process immediately
226227 watchCompilerHost . onUnRecoverableConfigFileDiagnostic = diagnosticReporter ;
Original file line number Diff line number Diff line change 66 es6 : true
77 node : true
88
9+ extends :
10+ plugin:vue/essential
11+
912parserOptions :
1013 # Local version of @typescript-eslint/parser
1114 parser : ' @typescript-eslint/parser'
Original file line number Diff line number Diff line change 1+ <!-- World.vue -->
2+ <template >
3+ <div >
4+ <div :id =" name" >
5+ {{ enthusiasm }}
6+ </div >
7+ <button @click =" decrement" >-</button >
8+ <button @click =" increment" >+</button >
9+ </div >
10+ </template >
11+
12+ <script lang="ts">
13+ import Vue from " vue" ;
14+ export default Vue .extend ({
15+ props: [' name' , ' initialEnthusiasm' ],
16+ data() {
17+ return {
18+ enthusiasm: this .initialEnthusiasm ,
19+ }
20+ },
21+ methods: {
22+ increment() { this .enthusiasm ++ ; },
23+ decrement() {
24+ if (this .enthusiasm > 1 ) {
25+ this .enthusiasm -- ;
26+ }
27+ },
28+ }
29+ });
30+ </script >
Original file line number Diff line number Diff line change @@ -59,5 +59,13 @@ export default Vue.extend({
5959" ,
6060 " warningCount": 0,
6161 },
62+ Object {
63+ " errorCount" : 0 ,
64+ " filePath" : " /usr/linked/World.vue" ,
65+ " fixableErrorCount" : 0 ,
66+ " fixableWarningCount" : 0 ,
67+ " messages" : Array [],
68+ " warningCount" : 0 ,
69+ } ,
6270]
6371`;
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ npm install $(npm pack /usr/eslint-plugin | tail -1)
1414# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early)
1515npm install vue-eslint-parser@latest
1616
17+ # Install the latest eslint-plugin-vue (this may break us occassionally, but it's probably good to get that feedback early)
18+ npm install eslint-plugin-vue@latest
19+
1720# Run the linting
1821# (the "|| true" helps make sure that we run our tests on failed linting runs as well)
1922npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/** /* .vue || true
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
33 "strict" : true
4- }
5- }
4+ },
5+ "include" : [
6+ " *.vue"
7+ ]
8+ }
You can’t perform that action at this time.
0 commit comments