Skip to content

Commit

Permalink
Conditionally apply eslint parserOptions
Browse files Browse the repository at this point in the history
This removes the `parserOptions` options that are not relevant for the `@typescript-eslint/parser' parser.

More information about the available options: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#configuration
  • Loading branch information
Windvis committed Oct 27, 2022
1 parent 24ef75b commit 32fe0dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
8 changes: 4 additions & 4 deletions blueprints/app/files/.eslintrc.js
Expand Up @@ -4,11 +4,11 @@ module.exports = {
root: true,
parser: '<%= typescript ? '@typescript-eslint/parser' : 'babel-eslint' %>',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2018,<% if (!typescript) { %>
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},<% } %>
},
plugins: ['ember'<% if (typescript) { %>, '@typescript-eslint'<% } %>],
extends: [
Expand Down Expand Up @@ -45,10 +45,10 @@ module.exports = {
'./server/**/*.js',<% } else { %>
'./tests/dummy/config/**/*.js',<% } %>
],
parserOptions: {
<% if (!typescript) { %> parserOptions: {
sourceType: 'script',
},
env: {
<% } %> env: {
browser: false,
node: true,
},
Expand Down
7 changes: 0 additions & 7 deletions tests/fixtures/addon/typescript/.eslintrc.js
Expand Up @@ -5,10 +5,6 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', '@typescript-eslint'],
extends: [
Expand Down Expand Up @@ -43,9 +39,6 @@ module.exports = {
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
Expand Down
7 changes: 0 additions & 7 deletions tests/fixtures/app/typescript-embroider/.eslintrc.js
Expand Up @@ -5,10 +5,6 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', '@typescript-eslint'],
extends: [
Expand Down Expand Up @@ -43,9 +39,6 @@ module.exports = {
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
Expand Down
7 changes: 0 additions & 7 deletions tests/fixtures/app/typescript/.eslintrc.js
Expand Up @@ -5,10 +5,6 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', '@typescript-eslint'],
extends: [
Expand Down Expand Up @@ -43,9 +39,6 @@ module.exports = {
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
Expand Down

0 comments on commit 32fe0dd

Please sign in to comment.