Skip to content

Commit

Permalink
feat: use only JS in eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
john-d-pelingo committed Dec 1, 2020
1 parent 9280b99 commit 82fc853
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 42 deletions.
23 changes: 2 additions & 21 deletions packages/eslint-config/.eslintrc.js
Expand Up @@ -4,22 +4,9 @@ const config = {
es6: true,
node: true,
},
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'jsx-a11y', 'react-hooks'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/react',
'prettier/@typescript-eslint',
'plugin:import/typescript',
],
plugins: ['import'],
extends: ['eslint:recommended', 'prettier'],
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': [
Expand All @@ -40,15 +27,9 @@ const config = {
},
],
'import/prefer-default-export': 'off',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
},
settings: {
'import/ignore': ['node_modules'],
react: {
version: 'detect',
},
},
}

Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-config/README.md
@@ -1,3 +1,4 @@
# @jdp-dev/eslint-config

My shareable [ESLint](https://eslint.org/) config.
My shareable [ESLint](https://eslint.org/) config for
[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) projects.
6 changes: 4 additions & 2 deletions packages/eslint-config/__tests__/validate-config.js
Expand Up @@ -8,9 +8,11 @@ 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>
const greet = (name) => {
console.log(\`Hello, \${name}!\`)
}
greet('John')
`

const result = cli.executeOnText(code)
Expand Down
21 changes: 3 additions & 18 deletions packages/eslint-config/package.json
@@ -1,7 +1,7 @@
{
"name": "@jdp-dev/eslint-config",
"version": "0.0.3",
"description": "My shareable ESLint config.",
"description": "My shareable ESLint config for JavaScript projects.",
"private": false,
"homepage": "https://github.com/john-d-pelingo/jdp-scripts",
"author": {
Expand All @@ -24,27 +24,12 @@
"test": "npm run lint && tape __tests__/*.js"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"eslint": "^7.14.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"react": "^17.0.1",
"typescript": "^4.1.2"
"eslint-plugin-import": "^2.22.1"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"eslint": "^7.14.0",
"eslint-config-airbnb-typescript": "^12.0.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"react": "^17.0.1",
"typescript": "^4.1.2"
"eslint-plugin-import": "^2.22.1"
}
}

0 comments on commit 82fc853

Please sign in to comment.