Skip to content

Commit

Permalink
feat: eslint-plugin-jsx-11y
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Dec 16, 2022
1 parent fec6e43 commit 100fd0a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notables change for @leomotors/config will be noted here

## [0.7.0] - 2022-12-16

- feat: eslint-plugin-jsx-11y

## [0.6.0] - 2022-12-16

- fix: typo 💀
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@leomotors/config",
"description": "My personal config for node projects, include ESLint Prettier and TSConfig",
"version": "0.6.0",
"version": "0.7.0",
"license": "MIT",
"author": {
"name": "Nutthapat Pongtanyavichai",
Expand Down Expand Up @@ -51,6 +51,7 @@
"eslint-config-next": "^13.0.7",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
Expand All @@ -69,6 +70,7 @@
"eslint-config-next": "^13.0.7",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
Expand All @@ -83,6 +85,9 @@
"eslint-config-next": {
"optional": true
},
"eslint-plugin-jsx-a11y": {
"optional": true
},
"eslint-plugin-react": {
"optional": true
},
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

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

10 changes: 8 additions & 2 deletions src/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ interface ReactConfigOptions {
export function reactConfig({ reactVersion }: ReactConfigOptions = {}) {
const _config = config();

assertDeps(["eslint-plugin-react"]);
assertDeps(["eslint-plugin-react", "eslint-plugin-jsx-a11y"]);

return {
..._config,
extends: [..._config.extends, "plugin:jsx-a11y/recommended"],
plugins: [..._config.plugins, "react"],
rules: {
..._config.rules,
Expand All @@ -72,6 +73,7 @@ export function reactConfig({ reactVersion }: ReactConfigOptions = {}) {
],
"react/jsx-key": "error",
"react/display-name": "error",
"react/no-unescaped-entities": "off",
},
settings: {
react: {
Expand All @@ -82,7 +84,11 @@ export function reactConfig({ reactVersion }: ReactConfigOptions = {}) {
}

export function nextConfig(opts?: ReactConfigOptions) {
assertDeps(["eslint-plugin-react", "eslint-config-next"]);
assertDeps([
"eslint-plugin-react",
"eslint-plugin-jsx-a11y",
"eslint-config-next",
]);

const base = reactConfig(opts);

Expand Down

0 comments on commit 100fd0a

Please sign in to comment.