Skip to content

Commit

Permalink
feat: extend eslint-config-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
john-d-pelingo committed Dec 1, 2020
1 parent aec2f7d commit 3bccd4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
29 changes: 1 addition & 28 deletions packages/eslint-config-typescript-react/.eslintrc.js
Expand Up @@ -7,38 +7,11 @@ const config = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'jsx-a11y', 'react-hooks'],
extends: [
'eslint:recommended',
'@jdp-dev/eslint-config-typescript',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
'plugin:import/typescript',
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-var-requires': 'off',
'import/no-default-export': 'error',
'import/no-deprecated': 'warn',
'import/order': [
'error',
{
pathGroupsExcludedImportTypes: ['builtin'],
groups: [
'builtin',
'external',
'internal',
'unknown',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
alphabetize: { order: 'asc' },
},
],
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
Expand Down
Expand Up @@ -8,8 +8,13 @@ test('load config in eslint to validate all rule syntax is correct', (t) => {
})

const code = `
const Hello = ({ name }: { name: string }) => {
return <div>Hello, {name}!</div>
import { getName } from 'lib'
import { exclamationMark } from './const'
const Hello = ({ surname }: { surname: string }) => {
const fullName = \`\${getName()} + \${surname}\`
return <div>Hello, {fullName}{exclamationMark}</div>
}
`

Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-typescript-react/package.json
Expand Up @@ -34,6 +34,7 @@
"typescript": "^4.1.2"
},
"dependencies": {
"@jdp-dev/eslint-config-typescript": "^0.0.5",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"eslint": "^7.14.0",
Expand Down

0 comments on commit 3bccd4b

Please sign in to comment.