diff --git a/src/cypress.ts b/src/cypress.ts index c3b08dd..f91f22a 100644 --- a/src/cypress.ts +++ b/src/cypress.ts @@ -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, diff --git a/src/index.ts b/src/index.ts index 3ddd710..91b8799 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, }, }, @@ -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, }, }, diff --git a/src/rxjs.ts b/src/rxjs.ts index 633d558..23c1f6a 100644 --- a/src/rxjs.ts +++ b/src/rxjs.ts @@ -12,17 +12,15 @@ export function rxjsConfig(files: string[] = ['**/*.ts?(x)']): Record