File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ module.exports = {
159159
160160 let result = null ;
161161 const filePath = options . filePath ;
162- if ( options . project ) {
162+ if ( options . project || options . projectService ) {
163163 jsCode = replaceExtensions ( jsCode ) ;
164164 }
165165
Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ import n from 'eslint-plugin-n';
2121import globals from 'globals' ;
2222import ts from 'typescript-eslint' ;
2323
24+
25+ import { createRequire } from 'node:module' ;
26+ const require = createRequire ( import . meta. url ) ;
27+ const manifestPath = require . resolve ( '@typescript-eslint/parser/package.json' ) ;
28+ const manifest = require ( manifestPath ) ;
29+ const isV8 = parseInt ( manifest . version [ 0 ] ) >= 8 ;
30+
2431const parserOptions = {
2532 esm : {
2633 js : {
@@ -29,7 +36,7 @@ const parserOptions = {
2936 } ,
3037 ts : {
3138 projectService : true ,
32- project : true ,
39+ ... ( isV8 ? { } : { project : true } ) ,
3340 tsconfigRootDir : import . meta. dirname ,
3441 } ,
3542 } ,
Original file line number Diff line number Diff line change 11{
22 "extends" : " @tsconfig/ember/tsconfig.json" ,
3- "include" : [" src/**/*" , " unpublished-development-types/**/*" ],
43 "compilerOptions" : {
54 "allowJs" : true ,
65 "declarationDir" : " declarations" ,
Original file line number Diff line number Diff line change 33const path = require ( 'path' ) ;
44
55const parserOptions = { } ;
6- if ( process . env . PROJECT_SERVICE ) {
6+ // if (process.env.PROJECT_SERVICE) {
77 parserOptions . projectService = {
8- defaultProject : process . env . DEFAULT_PROJECT || 'tsconfig.json' ,
8+ defaultProject : process . env . DEFAULT_PROJECT || process . env . PROJECT || 'tsconfig.json' ,
99 allowDefaultProject : process . env . ALLOW_DEFAULT_PROJECT === 'true' ? [ '**/*.js' ] : [ ]
1010 } ;
11- }
11+ // }
1212
1313parserOptions . tsconfigRootDir = process . env . TSCONFIG_ROOT_DIR || __dirname ;
1414parserOptions . project = process . env . PROJECT === undefined ? true : process . env . PROJECT ;
1515
16+ const manifestPath = require . resolve ( '@typescript-eslint/parser/package.json' ) ;
17+ const manifest = require ( manifestPath ) ;
18+ const isV8 = parseInt ( manifest . version [ 0 ] ) >= 8 ;
19+
20+ if ( isV8 ) {
21+ delete parserOptions . project ;
22+ }
23+
1624module . exports = {
1725 root : true ,
1826 parserOptions,
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const manifestPath = require . resolve ( '@typescript-eslint/parser/package.json' ) ;
4+ const manifest = require ( manifestPath ) ;
5+ const isV8 = parseInt ( manifest . version [ 0 ] ) >= 8 ;
6+
37module . exports = {
48 root : true ,
59 parserOptions : {
6- project : true ,
10+ ... ( isV8 ? { } : { project : true } ) ,
711 projectService : true ,
812 tsconfigRootDir : __dirname
913 } ,
You can’t perform that action at this time.
0 commit comments