Skip to content

Commit

Permalink
chore: add eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
buschtoens committed Feb 22, 2020
1 parent 86818c5 commit e2efa49
Show file tree
Hide file tree
Showing 8 changed files with 574 additions and 72 deletions.
60 changes: 1 addition & 59 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,4 @@
const fromPairs = require('lodash.frompairs');

module.exports = {
root: true,
plugins: ['ember', 'prettier'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended'
],
env: {
browser: true
},
rules: {
'ember/named-functions-in-promises': 'off',
'no-var': 'error',
'prefer-const': 'error'
},
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',
'lib/*/index.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
},
plugins: ['node'],
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
fromPairs(
Object.keys(
require('eslint-plugin-ember').configs.recommended.rules
).map(k => [k, 'off'])
),
{
// add your custom rules and overrides for node files here
}
)
}
]
extends: '@clark/node'
};
4 changes: 4 additions & 0 deletions addon/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@clark/ember'
};
4 changes: 4 additions & 0 deletions app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@clark/ember'
};
4 changes: 4 additions & 0 deletions lib/an-engine/addon/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@clark/ember'
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"ember-cli-htmlbars": "^4.0.0"
},
"devDependencies": {
"@clark/eslint-config-ember": "^1.22.0",
"@clark/eslint-config-node": "^1.21.0",
"@ember/optional-features": "^1.0.0",
"an-engine": "link:./lib/an-engine",
"broccoli-asset-rev": "^3.0.0",
Expand Down
4 changes: 4 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@clark/ember'
};
4 changes: 4 additions & 0 deletions tests/dummy/config/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@clark/node'
};
Loading

0 comments on commit e2efa49

Please sign in to comment.