open-nomad/ui/.eslintrc.js
Buck Doyle ca7c252a96
Add linting for classic decorator (#8182)
This completes an installation step I missed when making #8144 and
marks classes that are using the EmberObject APIs as classic.
2020-06-22 10:48:53 -05:00

83 lines
1.7 KiB
JavaScript

module.exports = {
root: true,
globals: {
server: true,
},
env: {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:ember/recommended',
],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: [
'ember'
],
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', 'avoid-escape'],
semi: ['error', 'always'],
'no-constant-condition': [
'error',
{
checkLoops: false,
},
],
'ember/classic-decorator-hooks': 'error',
'ember/classic-decorator-no-classic-methods': 'error',
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'server/**/*.js',
'lib/*/index.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off'
}),
},
{
files: [
'stories/**/*.js'
],
parserOptions: {
sourceType: 'module',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
},
],
};