Skip to content

Commit

Permalink
add button rule, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianwd committed Oct 26, 2024
1 parent 39d8cda commit 427fa87
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-turkeys-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"swd-eslint-config": patch
---

add react button rule, update readme
49 changes: 37 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,34 @@ This is a custom eslint config for my projects. It uses the latest flat config v
import tseslint from "typescript-eslint";

export default tseslint.config(
{
languageOptions: {
parserOptions: {
// Important for typed linting
parser: tseslint.parser,
tsconfigRootDir: import.meta.dirname,
project: ["./tsconfig.json"],
},
},
},
...swdEslintPlugin.configs.base,
// if using React:
...swdEslintPlugin.configs.react
);
```

or the flat config with classic syntax:

// or the flat config with classic syntax:
```ts
export default tseslint.config({
languageOptions: {
parserOptions: {
// Important for typed linting
parser: tseslint.parser,
tsconfigRootDir: import.meta.dirname,
project: ["./tsconfig.json"],
},
},
extends: [
...swdEslintPlugin.configs.base,
// if using React:
Expand All @@ -44,14 +65,18 @@ This is a custom eslint config for my projects. It uses the latest flat config v
};
```

```

- Plugins included:
- [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
- [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
- [eslint-plugin-tailwindcss](https://github.com/tailwindlabs/eslint-plugin-tailwindcss)
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)
- [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin)
```
### Plugins included:

- [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
- [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
- [eslint-plugin-tailwindcss](https://github.com/tailwindlabs/eslint-plugin-tailwindcss)
- [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)
- [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)
- [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin)

### Commands

- `pnpm build` - Builds the package
- `pnpm release` - Creates a new release, should be used before committing
- `pnpm release:publish` - Publishes the release, shouldn't be used manually
1 change: 1 addition & 0 deletions src/flat-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const react = tseslint.config(
rules: {
"react/prop-types": "off",
"react/display-name": "warn",
"react/button-has-type": "warn",
"tailwindcss/no-custom-classname": [
"warn",
{
Expand Down

0 comments on commit 427fa87

Please sign in to comment.