104f84f252
As discussed with the product team we want to enforce kebab-case file names for all files, with the exception of files which export a single class, in which case they should be PascalCase and reflect the class which they export. This will help find classes faster, and should push better naming for them too. Some files and packages have been excluded from this linting, specifically when a library or framework depends on the naming of a file for the functionality e.g. Ember, knex-migrator, adapter-manager
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
/* eslint-env node */
|
|
module.exports = {
|
|
root: true,
|
|
parser: '@babel/eslint-parser',
|
|
parserOptions: {
|
|
sourceType: 'module',
|
|
allowImportExportEverywhere: false,
|
|
ecmaFeatures: {
|
|
globalReturn: false,
|
|
legacyDecorators: true,
|
|
jsx: true
|
|
},
|
|
requireConfigFile: false,
|
|
babelOptions: {
|
|
plugins: [
|
|
'@babel/plugin-proposal-class-properties',
|
|
['@babel/plugin-proposal-decorators', {legacy: true}],
|
|
'babel-plugin-transform-react-jsx'
|
|
]
|
|
}
|
|
},
|
|
plugins: [
|
|
'ghost',
|
|
'react'
|
|
],
|
|
extends: [
|
|
'plugin:ghost/ember'
|
|
],
|
|
rules: {
|
|
'ghost/filenames/match-exported-class': ['off'],
|
|
'ghost/filenames/match-regex': ['off'],
|
|
'no-shadow': ['error'],
|
|
|
|
// TODO: migrate away from accessing controller in routes
|
|
'ghost/ember/no-controller-access-in-routes': 'off',
|
|
|
|
// TODO: enable once we're fully on octane 🏎
|
|
'ghost/ember/no-assignment-of-untracked-properties-used-in-tracking-contexts': 'off',
|
|
'ghost/ember/no-actions-hash': 'off',
|
|
'ghost/ember/no-classic-classes': 'off',
|
|
'ghost/ember/no-classic-components': 'off',
|
|
'ghost/ember/require-tagless-components': 'off',
|
|
'ghost/ember/no-component-lifecycle-hooks': 'off',
|
|
|
|
// disable linting of `this.get` until there's a reliable autofix
|
|
'ghost/ember/use-ember-get-and-set': 'off',
|
|
|
|
// disable linting of mixins until we migrate away
|
|
'ghost/ember/no-mixins': 'off',
|
|
'ghost/ember/no-new-mixins': 'off',
|
|
|
|
'react/jsx-uses-react': 'error',
|
|
'react/jsx-uses-vars': 'error'
|
|
}
|
|
};
|