Skip to content

Commit

Permalink
Update typescript-eslint parser options
Browse files Browse the repository at this point in the history
  • Loading branch information
amikheychik committed Dec 31, 2024
1 parent 829a376 commit dd38be9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
10 changes: 4 additions & 6 deletions src/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ export function cypressConfig(files: string[] = ['cypress/**/*.[jt]s']): Record<
// so skipping them until it's possible to add directory configuration for Jest rules.
files,
languageOptions: {
...cypressOptionalConfig.languageOptions,
sourceType: 'module',
ecmaVersion: 'latest',
parser: tsEslint.parser,
parserOptions: {
// Parser options have to be duplicated when the parser is overridden
ecmaVersion: 6,
ecmaFeatures: {
globalReturn: false,
impliedStrict: true,
},
sourceType: 'module',
// TypeScript ESLint Parser
project: './tsconfig.json',
projectService: true,
warnOnUnsupportedTypeScriptVersion: true,
},
...cypressOptionalConfig.languageOptions,
},
plugins: {
...cypressOptionalConfig.plugins,
Expand Down
19 changes: 9 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ export default [
{
files: ['**/*.[jt]s?(x)'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parser: tsEslint.parser,
parserOptions: {
// Parser options have to be duplicated when the parser is overridden
ecmaVersion: 6,
ecmaFeatures: {
globalReturn: false,
impliedStrict: true,
},
sourceType: 'module',
// TypeScript ESLint Parser
project: './tsconfig.json',
projectService: {
// Allow parsing JS config files that are not listed in the tsconfig
allowDefaultProject: ['?(.)*.?(m|c)js'],
},
warnOnUnsupportedTypeScriptVersion: true,
},
},
Expand Down Expand Up @@ -111,17 +112,15 @@ export default [
{
files: ['**/*.ts?(x)'],
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parser: tsEslint.parser,
parserOptions: {
// Parser options have to be duplicated when the parser is overridden
ecmaVersion: 6,
ecmaFeatures: {
globalReturn: false,
impliedStrict: true,
},
sourceType: 'module',
// TypeScript ESLint Parser
project: './tsconfig.json',
projectService: true,
warnOnUnsupportedTypeScriptVersion: true,
},
},
Expand Down
8 changes: 3 additions & 5 deletions src/rxjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ export function rxjsConfig(files: string[] = ['**/*.ts?(x)']): Record<string, un
return {
files,
languageOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
parser: tsEslint.parser,
parserOptions: {
// Parser options have to be duplicated when the parser is overridden
ecmaVersion: 6,
ecmaFeatures: {
globalReturn: false,
impliedStrict: true,
},
sourceType: 'module',
// TypeScript ESLint Parser
project: './tsconfig.json',
projectService: true,
warnOnUnsupportedTypeScriptVersion: true,
},
},
Expand Down

0 comments on commit dd38be9

Please sign in to comment.