Skip to content

Add support for eslint v9 #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ or

npm i --save-dev eslint-plugin-styled-components-a11y

### Configuration
### Configuration - Legacy Config (`.eslintrc`)

Add styled-components-a11y to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

Expand Down Expand Up @@ -100,6 +100,41 @@ Alternatively, you can configure individual rules under the rules section.
}
```

### Configuration - Flat Config

The default export is a plugin object:

```js
import styledA11y from 'eslint-plugin-styled-components-a11y';

export default [
{
plugins: {
'styled-components-a11y': styledA11y,
},
rules: {
'styled-components-a11y/rule-name': 2,
},
},
];
```

#### Shareable Configs

There are two shareable configs provided by the plugin:

- `flatConfigs.recommended`
- `flatConfigs.strict`

```js
import styledA11y from 'eslint-plugin-styled-components-a11y';

export default [
styledA11y.flatConfigs.recommended,
// ... additional configs
];
```

## Examples

a working repo can be found [here](https://github.com/brendanmorrell/styled-components-a11y-example) at brendanmorrell/styled-components-a11y-example which has a file illustrating the linting rules in action for the above four styled component types the library is currently capable of handling
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
"nodemon": "^2.0.2"
},
"peerDependencies": {
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8"
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9"
}
}
Loading