Skip to content

Commit

Permalink
Merge pull request #55 from lifeomic/react-standards
Browse files Browse the repository at this point in the history
feat: add @lifeomic/react/standards
  • Loading branch information
aecorredor authored Oct 25, 2024
2 parents afd7032 + f17f90d commit b30b6e0
Show file tree
Hide file tree
Showing 4 changed files with 364 additions and 30 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
This repo contains [ESLint configurations](https://eslint.org/docs/developer-guide/shareable-configs) to help enforce code standards at LifeOmic.
This repo contains [ESLint configurations](https://eslint.org/docs/developer-guide/shareable-configs)
to help enforce code standards at LifeOmic.

## Usage

Expand All @@ -14,10 +15,21 @@ module.exports = {
}
```

or for a React project:

```javascript
// eslintrc.js
module.exports = {
extends: ['@lifeomic/standards', '@lifeomic/standards/react'],
...
}
```

## Configurations
This package provides a handful of configurations:

- [`@lifeomic/standards`](lib/index.js)
- [`@lifeomic/standards/javascript`](lib/javascript.js)
- [`@lifeomic/standards/typescript`](lib/typescript.js)
- [`@lifeomic/standards/jest`](lib/jest.js)
- [`@lifeomic/standards/react`](lib/react.js)
10 changes: 10 additions & 0 deletions lib/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
extends: [
'plugin:react-hooks/recommended',
],
plugins: ['react-hooks', 'react-compiler'],
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-compiler/react-compiler': 'error',
},
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsdoc": "^46.4.4",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-react-compiler": "^19.0.0-beta-8a03594-20241020",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0"
}
}
Loading

0 comments on commit b30b6e0

Please sign in to comment.