Skip to content

Commit

Permalink
Merge pull request #3 from Boehringer-Ingelheim/feature/typescript-enum
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms authored Mar 1, 2023
2 parents 46282c6 + cd7fc5c commit e28e04d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ module.exports = {
};
```

This shared ESLint configuration is specifically tailored for [React](https://reactjs.org/) projects, and extends `@boehringer-ingelheim/eslint-config/base`. It uses the browser environment, and includes recommended configurations for the following plugins: jsx-a11y, react, and react-hooks.
This shared ESLint configuration is specifically tailored for [React](https://reactjs.org/) projects, and extends `@boehringer-ingelheim/eslint-config/base`. It uses the browser environment, and includes recommended configurations for the following plugins:

- [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
- [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react)
- [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
- [`eslint-plugin-typescript-enum`](https://github.com/shian15810/eslint-plugin-typescript-enum)

The configuration sets several custom rules, including `@typescript-eslint/ban-types` and `@typescript-eslint/consistent-type-definitions`, as well as rules for organizing and formatting import statements.

Expand Down
51 changes: 48 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sonarjs": "^0.18.0",
"eslint-plugin-sort-keys-plus": "^1.3.1"
"eslint-plugin-sort-keys-plus": "^1.3.1",
"eslint-plugin-typescript-enum": "^2.1.0"
},
"devDependencies": {
"@boehringer-ingelheim/prettier-config": "1.0.0",
Expand Down
10 changes: 8 additions & 2 deletions react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ module.exports = {
env: {
browser: true,
},
extends: ["../base/index.js", "plugin:jsx-a11y/recommended", "plugin:react/recommended", "plugin:react/jsx-runtime"],
extends: [
"../base/index.js",
"plugin:jsx-a11y/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:typescript-enum/recommended",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["jsx-a11y", "react", "react-hooks"],
plugins: ["jsx-a11y", "react", "react-hooks", "typescript-enum"],
rules: {
// @typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules
"@typescript-eslint/ban-types": [
Expand Down

0 comments on commit e28e04d

Please sign in to comment.