Skip to content

Commit ea2db16

Browse files
Merge pull request #66 from leiit/feat/eslint-9-support
Add support for eslint v9
2 parents 90c8bdb + 8797544 commit ea2db16

File tree

4 files changed

+250
-198
lines changed

4 files changed

+250
-198
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ or
7272

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

75-
### Configuration
75+
### Configuration - Legacy Config (`.eslintrc`)
7676

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

@@ -100,6 +100,41 @@ Alternatively, you can configure individual rules under the rules section.
100100
}
101101
```
102102

103+
### Configuration - Flat Config
104+
105+
The default export is a plugin object:
106+
107+
```js
108+
import styledA11y from 'eslint-plugin-styled-components-a11y';
109+
110+
export default [
111+
{
112+
plugins: {
113+
'styled-components-a11y': styledA11y,
114+
},
115+
rules: {
116+
'styled-components-a11y/rule-name': 2,
117+
},
118+
},
119+
];
120+
```
121+
122+
#### Shareable Configs
123+
124+
There are two shareable configs provided by the plugin:
125+
126+
- `flatConfigs.recommended`
127+
- `flatConfigs.strict`
128+
129+
```js
130+
import styledA11y from 'eslint-plugin-styled-components-a11y';
131+
132+
export default [
133+
styledA11y.flatConfigs.recommended,
134+
// ... additional configs
135+
];
136+
```
137+
103138
## Examples
104139

105140
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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@
6464
"nodemon": "^2.0.2"
6565
},
6666
"peerDependencies": {
67-
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8"
67+
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9"
6868
}
6969
}

0 commit comments

Comments
 (0)