Skip to content

Commit

Permalink
Set eslint rules for all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykay-p committed Dec 9, 2020
1 parent f34bbbf commit 92ce8fc
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 58 deletions.
27 changes: 6 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,16 @@
"node": true
},
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:react/recommended", "airbnb", "prettier"],
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["react", "react-hooks", "prettier"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prefer-stateless-function": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"no-nested-ternary": "off",
"react/jsx-props-no-spreading": "off",
"react/prop-types": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
},
"globals": {
"React": "writable"
}
}
"plugins": ["prettier"]
}
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
"name": "root",
"private": true,
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"babel-eslint": "^10.1.0",
"eslint": "^7.15.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.3.4",
"lerna": "^3.22.1",
"lint-staged": "^10.5.3",
"prettier": "^2.2.1",
"babel-eslint": "^10.1.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-babel": "^5.3.1",
"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"
"typescript": "^4.1.2"
},
"workspaces": [
"packages/*"
Expand Down
34 changes: 34 additions & 0 deletions packages/dodam-components/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": [
"../../.eslintrc.json",
"airbnb",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"plugins": ["react", "react-hooks", "prettier"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prefer-stateless-function": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"no-nested-ternary": "off",
"react/jsx-props-no-spreading": "off",
"react/prop-types": "off"
},
"overrides": [
{
"files": ["*.tsx"],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off"
}
}
]
}
6 changes: 3 additions & 3 deletions packages/dodam-components/src/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const Button = () => <button type="button">Button</button>;

export default Button;
export default function Button() {
return <button type="button">test</button>;
}
20 changes: 0 additions & 20 deletions packages/dodam-server/.eslintrc.json

This file was deleted.

23 changes: 23 additions & 0 deletions packages/dodam/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": ["../../.eslintrc.json", "plugin:react/recommended", "airbnb", "prettier"],
"parser": "babel-eslint",
"settings": {
"react": {
"version": "detect"
}
},
"plugins": ["react", "react-hooks", "prettier"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/prefer-stateless-function": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"no-nested-ternary": "off",
"react/jsx-props-no-spreading": "off",
"react/prop-types": "off",
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
},
"globals": {
"React": "writable"
}
}
Loading

0 comments on commit 92ce8fc

Please sign in to comment.