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

Commit

Permalink
ci: update eslint config with latest guidelines (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
chambo-e authored Dec 20, 2022
1 parent 3201f4f commit 06b4de2
Show file tree
Hide file tree
Showing 18 changed files with 108 additions and 173 deletions.
58 changes: 18 additions & 40 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,32 @@
"env": {
"browser": true
},
"extends": [
"@scaleway/react/typescript",
"plugin:react/jsx-runtime"
],
"parserOptions": {
"project": [
"tsconfig.json"
]
},
"plugins": [
"@emotion"
],
"rules": {
// Import
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/__stories__/**/*",
"**/__tests__/**/*",
"**/jestHelpers.tsx",
"rollup.config.mjs"
]
}
],
// emotion
"@emotion/styled-import": "error",
"@emotion/no-vanilla": "error",
"@emotion/import-from-emotion": "error",
"@emotion/syntax-preference": [
"error",
"string"
]
},
"overrides": [
{
"files": ["*.js", "*.mjs"],
"extends": ["@scaleway/react", "@scaleway/react/emotion"],
"parser": "@babel/eslint-parser"
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["@scaleway/react/typescript", "@scaleway/react/emotion"],
"parserOptions": {
"project": ["tsconfig.json"]
}
},
{
"files": ["**/__stories__/**/*.{ts,tsx}", "**/__tests__/**/*.{ts,tsx}"],
"extends": ["@scaleway/react/typescript"],
"parserOptions": {
"project": ["tsconfig.json"]
},
"env": {
"jest": true
},
"files": [
"**/__stories__/**/*.{ts,tsx}",
"**/__tests__/**/*.{ts,tsx}"
],
"rules": {
"no-console": "off",
"no-alert": "off",
"react/prop-types": "off",
"react/jsx-props-no-spreading": "off"
"react/jsx-props-no-spreading": "off",
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/jestHelpers.tsx → .jest/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import makeHelpers from '@scaleway/jest-helpers'
import { theme as lightTheme } from '@scaleway/ui'
import { render } from '@testing-library/react'
import type { ComponentProps, ReactElement, ReactNode } from 'react'
import { Form } from '../components'
import { mockErrors } from '../mocks'
import { Form } from '../src/components'
import { mockErrors } from '../src/mocks'

type WrapperProps = {
theme?: typeof lightTheme
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-node-resolve": "15.0.1",
"@rollup/plugin-url": "8.0.1",
"@scaleway/eslint-config-react": "3.11.2",
"@scaleway/eslint-config-react": "3.13.0",
"@scaleway/jest-helpers": "2.0.24",
"@scaleway/tsconfig": "1.1.0",
"@semantic-release/changelog": "6.0.2",
Expand Down
Loading

0 comments on commit 06b4de2

Please sign in to comment.