Skip to content

Commit

Permalink
Merge pull request #10359 from vishal423/fix-eslint-config-integratio…
Browse files Browse the repository at this point in the history
…n-react

react: use jhipster eslint shareable configurations
  • Loading branch information
vishal423 authored Sep 5, 2019
2 parents 83ac5f8 + 5fa04d0 commit 4277d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 73 deletions.
76 changes: 3 additions & 73 deletions generators/client/templates/react/.eslintrc.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,79 +17,9 @@
limitations under the License.
-%>
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
"prettier/@typescript-eslint",
"eslint-config-prettier"
],
"env": {
"browser": true,
"es6": true,
"commonjs": true
},
"extends": ["jhipster-react"],
"parserOptions": {
"project": "./<% if (protractorTests) { %>tsconfig.e2e.json<% } else { %>tsconfig.json<% } %>",
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
"project": "./<% if (protractorTests) { %>tsconfig.e2e.json<% } else { %>tsconfig.json<% } %>"
},
"rules": {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-parameter-properties": ["warn", { "allows": ["public", "private", "protected"] }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Object": "Use {} instead."
}
}
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": ["static-field", "instance-field", "constructor", "static-method", "instance-method"]
}
],
"@typescript-eslint/array-type": "off",
"@typescript-eslint/unbound-method": "off",
"spaced-comment": ["warn", "always"],
"guard-for-in": "error",
"no-labels": "error",
"no-caller": "error",
"no-bitwise": "error",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-new-wrappers": "error",
"no-eval": "error",
"no-shadow": "error",
"no-new": "error",
"no-var": "error",
"radix": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"prefer-const": "error",
"object-shorthand": ["error", "always", { "avoidExplicitReturnArrows": true }],
"default-case": "error",
"complexity": ["error", 40],
"no-invalid-this": "off",

"react/prop-types": "off",
"react/display-name": "off"
}
"rules": {}
}
2 changes: 2 additions & 0 deletions generators/client/templates/react/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ limitations under the License.
"enzyme-adapter-react-16": "1.11.2",
"enzyme-to-json": "3.3.5",
"eslint": "6.1.0",
"eslint-config-jhipster": "0.0.1",
"eslint-config-jhipster-react": "0.0.1",
"eslint-config-prettier": "6.0.0",
"eslint-loader": "2.2.1",
"eslint-plugin-react": "7.14.3",
Expand Down

0 comments on commit 4277d58

Please sign in to comment.