Skip to content

Commit

Permalink
chore(ESLint): Make strict-boolean-expressions more flexible. Close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed May 27, 2020
1 parent c7d59f2 commit 079707f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
13 changes: 11 additions & 2 deletions packages/eslint-config/eslint-config-stencil.js
Expand Up @@ -3,9 +3,18 @@ const defaultConfig = require('./eslint-config')
module.exports = {
...defaultConfig,
extends: ['plugin:@stencil/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-unused-vars-experimental': [
'error',
{
ignoredNamesRegex: '^_|^component(Will|Did)(Un)?[Ll]oad'
}
]
},
parserOptions: {
...defaultConfig.parserOptions,
project: './tsconfig.json',
jsx: true
}
jsx: true,
},
}
24 changes: 13 additions & 11 deletions packages/eslint-config/eslint-config.js
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended'
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier'],
rules: {
Expand All @@ -15,15 +15,15 @@ module.exports = {
{
functions: false,
// Because sometimes we define functions using const func = ...
variables: false
}
variables: false,
},
],
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
allowHigherOrderFunctions: true
}
allowHigherOrderFunctions: true,
},
],
'@typescript-eslint/ban-ts-ignore': 'warn',
'@typescript-eslint/await-thenable': 'warn',
Expand All @@ -33,7 +33,10 @@ module.exports = {
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/strict-boolean-expressions': [
'error',
{ allowNullable: true }
{
allowString: false,
allowNullableBoolean: true,
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
Expand All @@ -42,13 +45,12 @@ module.exports = {
// const { content, ...rest } = node
// return rest
ignoreRestSiblings: true,
varsIgnorePattern: 'h' // This is for JSX support in StencilJS
}
]
},
],
},
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018,
sourceType: 'module'
}
sourceType: 'module',
},
}

0 comments on commit 079707f

Please sign in to comment.