Skip to content

Commit

Permalink
update ts eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Roebuck committed Jul 28, 2022
1 parent dafd07f commit 0c0c7dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,29 @@ module.exports = {
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
alias: eslintDirAlias,
},
},
overrides: [
{
files: ['**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'react/jsx-filename-extension': [
2,
{
extensions: ['.jsx', '.tsx'],
},
],
...{
// adds support for type, interface and enum declarations https://typescript-eslint.io/rules/no-use-before-define/#how-to-use
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"test:dependencies": "node ./scripts/dependencyCheck",
"test:e2e": "yarn stop && yarn build && run-p --race start cypress",
"test:e2e:interactive": "yarn stop && yarn build && run-p --race start cypress:interactive",
"test:lint": "eslint --ext .js,jsx,json ./src ./data ./cypress ./.storybook ./webpack** && stylelint 'src/**/*.js' 'src/**/*.jsx'",
"test:lint": "eslint --ext .js,jsx,json,ts,tsx ./src ./data ./cypress ./.storybook ./webpack** && stylelint 'src/**/*.js' 'src/**/*.jsx'",
"test:puppeteer": "jest --ci --env=jsdom --colors ./puppeteer",
"test:unit": "test -z $CI && jest --env=jsdom --coverage --colors --testPathIgnorePatterns=\"src/integration\" \"puppeteer\" || jest --ci --runInBand --env=jsdom --coverage --colors --testPathIgnorePatterns=\"src/integration\" \"puppeteer\"",
"test:unit:watch": "yarn test:unit -- --watch",
Expand Down

0 comments on commit 0c0c7dc

Please sign in to comment.