Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 06b4de2

Browse files
authored
ci: update eslint config with latest guidelines (#592)
1 parent 3201f4f commit 06b4de2

File tree

18 files changed

+108
-173
lines changed

18 files changed

+108
-173
lines changed

.eslintrc

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,32 @@
33
"env": {
44
"browser": true
55
},
6-
"extends": [
7-
"@scaleway/react/typescript",
8-
"plugin:react/jsx-runtime"
9-
],
10-
"parserOptions": {
11-
"project": [
12-
"tsconfig.json"
13-
]
14-
},
15-
"plugins": [
16-
"@emotion"
17-
],
18-
"rules": {
19-
// Import
20-
"import/no-extraneous-dependencies": [
21-
"error",
22-
{
23-
"devDependencies": [
24-
"**/__stories__/**/*",
25-
"**/__tests__/**/*",
26-
"**/jestHelpers.tsx",
27-
"rollup.config.mjs"
28-
]
29-
}
30-
],
31-
// emotion
32-
"@emotion/styled-import": "error",
33-
"@emotion/no-vanilla": "error",
34-
"@emotion/import-from-emotion": "error",
35-
"@emotion/syntax-preference": [
36-
"error",
37-
"string"
38-
]
39-
},
406
"overrides": [
417
{
8+
"files": ["*.js", "*.mjs"],
9+
"extends": ["@scaleway/react", "@scaleway/react/emotion"],
10+
"parser": "@babel/eslint-parser"
11+
},
12+
{
13+
"files": ["*.ts", "*.tsx"],
14+
"extends": ["@scaleway/react/typescript", "@scaleway/react/emotion"],
15+
"parserOptions": {
16+
"project": ["tsconfig.json"]
17+
}
18+
},
19+
{
20+
"files": ["**/__stories__/**/*.{ts,tsx}", "**/__tests__/**/*.{ts,tsx}"],
21+
"extends": ["@scaleway/react/typescript"],
22+
"parserOptions": {
23+
"project": ["tsconfig.json"]
24+
},
4225
"env": {
4326
"jest": true
4427
},
45-
"files": [
46-
"**/__stories__/**/*.{ts,tsx}",
47-
"**/__tests__/**/*.{ts,tsx}"
48-
],
4928
"rules": {
5029
"no-console": "off",
5130
"no-alert": "off",
52-
"react/prop-types": "off",
53-
"react/jsx-props-no-spreading": "off"
31+
"react/jsx-props-no-spreading": "off",
5432
}
5533
}
5634
]

src/helpers/jestHelpers.tsx renamed to .jest/helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import makeHelpers from '@scaleway/jest-helpers'
33
import { theme as lightTheme } from '@scaleway/ui'
44
import { render } from '@testing-library/react'
55
import type { ComponentProps, ReactElement, ReactNode } from 'react'
6-
import { Form } from '../components'
7-
import { mockErrors } from '../mocks'
6+
import { Form } from '../src/components'
7+
import { mockErrors } from '../src/mocks'
88

99
type WrapperProps = {
1010
theme?: typeof lightTheme

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
"@rollup/plugin-babel": "6.0.3",
139139
"@rollup/plugin-node-resolve": "15.0.1",
140140
"@rollup/plugin-url": "8.0.1",
141-
"@scaleway/eslint-config-react": "3.11.2",
141+
"@scaleway/eslint-config-react": "3.13.0",
142142
"@scaleway/jest-helpers": "2.0.24",
143143
"@scaleway/tsconfig": "1.1.0",
144144
"@semantic-release/changelog": "6.0.2",

0 commit comments

Comments
 (0)