Initial move towards new ESLint config supporting TS
Co-authored-by: Sidney Keese <sidney@carbonfive.com>
This commit is contained in:
parent
c2aa8eb82b
commit
5b1536cc02
22 changed files with 3300 additions and 597 deletions
47
.eslintrc.js
47
.eslintrc.js
|
@ -1,7 +1,11 @@
|
|||
// For reference: https://github.com/airbnb/javascript
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
'import/core-modules': ['electron'],
|
||||
},
|
||||
|
||||
|
@ -9,6 +13,35 @@ module.exports = {
|
|||
|
||||
plugins: ['mocha', 'more'],
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react/recommended',
|
||||
'airbnb-typescript-prettier',
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ['**/*.stories.tsx'],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
'react/jsx-props-no-spreading': 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
rules: {
|
||||
'comma-dangle': [
|
||||
'error',
|
||||
|
@ -37,7 +70,19 @@ module.exports = {
|
|||
'no-console': 'error',
|
||||
|
||||
// consistently place operators at end of line except ternaries
|
||||
'operator-linebreak': 'error',
|
||||
'operator-linebreak': [
|
||||
'error',
|
||||
'after',
|
||||
{ overrides: { '?': 'ignore', ':': 'ignore' } },
|
||||
],
|
||||
|
||||
// Temporarily turned off during transition from TSLint
|
||||
// JIRA: DESKTOP-623
|
||||
'import/order': 'off',
|
||||
'no-else-return': 'off',
|
||||
'no-async-promise-executor': 'off',
|
||||
'prefer-object-spread': 'off',
|
||||
strict: 'off',
|
||||
|
||||
quotes: [
|
||||
'error',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue