Skip to content

Commit 4aa5474

Browse files
authored
feat(eslint-config-react): add standalone emotion configuration (#1121)
* feat(eslint-config-react): add standalone emotion configuration * fix: correct imports * fix: correct css prop * fix: revert
1 parent b4d3b12 commit 4aa5474

File tree

5 files changed

+2327
-6352
lines changed

5 files changed

+2327
-6352
lines changed

.eslintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
{
1717
"parser": "@babel/eslint-parser",
1818
"files": ["*.js", "*.mjs"],
19-
"extends": "@scaleway/react/index.js"
19+
"extends": "@scaleway/react"
2020
},
2121
{
2222
"files": ["*.ts", "*.tsx"],
2323
"parserOptions": {
2424
"project": ["tsconfig.json"]
2525
},
26-
"extends": ["@scaleway/react/typescript.js"]
26+
"extends": ["@scaleway/react/typescript"]
2727
}
2828
]
2929
}

packages/eslint-config-react/README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ Add to your `.eslintrc`
1818

1919
```json
2020
{
21-
"extends": "@scaleway/react"
21+
"extends": ["@scaleway/react]"
2222
}
2323
```
2424

2525
Or for Typescript
2626

2727
```json
2828
{
29-
"extends": "@scaleway/react/typescript",
29+
"extends": ["@scaleway/react/typescript"],
3030
"parserOptions": {
3131
"project": "./path/to/tsconfig.json"
3232
}
3333
}
3434
```
35+
36+
We also have a standalong emotion configuration
37+
38+
```json
39+
{
40+
"extends": ["@scaleway/react", "@scaleway/react/emotion"]
41+
}
42+
```
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
plugins: ['@emotion'],
3+
rules: {
4+
'react/no-unknown-property': [
5+
'error',
6+
{
7+
ignore: ['css'],
8+
},
9+
],
10+
'@emotion/import-from-emotion': 'error',
11+
'@emotion/no-vanilla': 'error',
12+
'@emotion/styled-import': 'error',
13+
'@emotion/syntax-preference': ['error', 'string'],
14+
},
15+
}

packages/eslint-config-react/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"license": "MIT",
1919
"dependencies": {
20+
"@emotion/eslint-plugin": "11.10.0",
2021
"@typescript-eslint/eslint-plugin": "5.46.1",
2122
"@typescript-eslint/parser": "5.46.1",
2223
"eslint-config-airbnb": "19.0.4",

0 commit comments

Comments
 (0)