Skip to content

Commit

Permalink
refactor: define an ember-core eslint config for ember-app and ember-…
Browse files Browse the repository at this point in the history
…addon configs
  • Loading branch information
GreatWizard committed Feb 18, 2021
1 parent 46ca036 commit 2fc93ac
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 69 deletions.
36 changes: 1 addition & 35 deletions ember-addon.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
module.exports = {
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
"ember",
"ember-suave"
],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:ember-suave/recommended",
"./core.js"
"./ember-core.js"
],
env: {
browser: true
},
rules: {
"ember/no-jquery": "warn",
"ember-suave/require-access-in-comments": "off"
},
overrides: [
// node files
{
files: [
".eslintrc.js",
".template-lintrc.js",
"ember-cli-build.js",
"index.js",
"testem.js",
"blueprints/*/index.js",
"config/**/*.js",
"tests/dummy/config/**/*.js"
],
excludedFiles: [
Expand All @@ -57,13 +30,6 @@ module.exports = {
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}
},
// testem config file
{
files: ["testem.js"],
rules: {
camelcase: "off"
}
}
]
}
60 changes: 60 additions & 0 deletions ember-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module.exports = {
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
"ember",
"ember-suave"
],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:ember-suave/recommended",
"./core.js"
],
env: {
browser: true
},
rules: {
"ember/no-jquery": "warn",
"ember-suave/require-access-in-comments": "off"
},
overrides: [
// node files
{
files: [
".eslintrc.js",
".template-lintrc.js",
"ember-cli-build.js",
"testem.js",
"config/**/*.js"
],
parserOptions: {
sourceType: "script"
},
env: {
browser: false,
node: true
},
plugins: ["node"],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}
},
// testem config file
{
files: ["testem.js"],
rules: {
camelcase: "off"
}
}
]
}
35 changes: 1 addition & 34 deletions ember.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
module.exports = {
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: [
"ember",
"ember-suave"
],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:ember-suave/recommended",
"./core.js"
"./ember-core.js"
],
env: {
browser: true
},
rules: {
"ember/no-jquery": "warn",
"ember-suave/require-access-in-comments": "off"
},
overrides: [
// node files
{
files: [
".eslintrc.js",
".template-lintrc.js",
"ember-cli-build.js",
"testem.js",
"config/**/*.js",
"lib/*/index.js",
"server/**/*.js"
Expand All @@ -50,13 +24,6 @@ module.exports = {
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}
},
// testem config file
{
files: ["testem.js"],
rules: {
camelcase: "off"
}
}
]
}

0 comments on commit 2fc93ac

Please sign in to comment.