summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md36
-rw-r--r--rollup.config.js2
-rw-r--r--src/react-typescript.ts27
3 files changed, 57 insertions, 8 deletions
diff --git a/README.md b/README.md
index 2eec63c..84bb792 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,8 @@
* `javascript`
* `typescript`
+* `react-javascript`
+* `react-typescript`
* `vue-javascript`
* `vue-typescript`
@@ -27,16 +29,34 @@
* Install dependencies:
```shell script
-npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser \
- @valentineus/eslint-config eslint eslint-plugin-eslint-comments \
- eslint-plugin-import eslint-plugin-security eslint-plugin-sonarjs \
- eslint-plugin-unicorn eslint-plugin-vue
+npm install --save-dev @typescript-eslint/eslint-plugin \
+ @typescript-eslint/parser \
+ @valentineus/eslint-config \
+ eslint \
+ eslint-plugin-eslint-comments \
+ eslint-plugin-import \
+ eslint-plugin-jsx-a11y \
+ eslint-plugin-react \
+ eslint-plugin-react-hooks \
+ eslint-plugin-security \
+ eslint-plugin-sonarjs \
+ eslint-plugin-unicorn \
+ eslint-plugin-vue
# or
-yarn add --dev @typescript-eslint/eslint-plugin @typescript-eslint/parser \
- @valentineus/eslint-config eslint eslint-plugin-eslint-comments \
- eslint-plugin-import eslint-plugin-security eslint-plugin-sonarjs \
- eslint-plugin-unicorn eslint-plugin-vue
+yarn add --dev @typescript-eslint/eslint-plugin \
+ @typescript-eslint/parser \
+ @valentineus/eslint-config \
+ eslint \
+ eslint-plugin-eslint-comments \
+ eslint-plugin-import \
+ eslint-plugin-jsx-a11y \
+ eslint-plugin-react \
+ eslint-plugin-react-hooks \
+ eslint-plugin-security \
+ eslint-plugin-sonarjs \
+ eslint-plugin-unicorn \
+ eslint-plugin-vue
```
* Create config file:
diff --git a/rollup.config.js b/rollup.config.js
index 4f5794e..bcdea49 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -5,6 +5,8 @@ import { terser } from "rollup-plugin-terser";
module.exports = {
input: {
"javascript": "src/javascript.ts",
+ "react-javascript": "src/react-javascript.ts",
+ "react-typescript": "src/react-typescript.ts",
"typescript": "src/typescript.ts",
"vue-javascript": "src/vue-javascript.ts",
"vue-typescript": "src/vue-typescript.ts",
diff --git a/src/react-typescript.ts b/src/react-typescript.ts
new file mode 100644
index 0000000..a63614e
--- /dev/null
+++ b/src/react-typescript.ts
@@ -0,0 +1,27 @@
+import rJsxA11y from "./rules/jsx-a11y/default.json";
+import rReactHooks from "./rules/react-hooks/default.json";
+import rDefault from "./rules/react/default.json";
+
+module.exports = {
+ "extends": [
+ "./typescript",
+ "plugin:jsx-a11y/recommended",
+ "plugin:react-hooks/recommended",
+ "plugin:react/recommended",
+ ],
+ "parserOptions": {
+ ecmaFeatures: {
+ jsx: true,
+ },
+ },
+ "plugins": [
+ "jsx-a11y",
+ "react",
+ "react-hooks",
+ ],
+ "rules": {
+ ...rDefault,
+ ...rJsxA11y,
+ ...rReactHooks,
+ },
+};