Skip to content

Commit e9e75cb

Browse files
committed
chore: Update eslint „quotes“ rule
Since typescript-eslint/typescript-eslint#762 is published the normal quotes rule can be disabled and the typescript one activated. This allows me to use backticks, but they won’t get added to types (they are not valid there)
1 parent 796180c commit e9e75cb

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

.eslintrc.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ module.exports = {
4444
"allowTaggedTemplates": true
4545
}
4646
],
47+
quotes: "off",
48+
"@typescript-eslint/quotes": [
49+
2,
50+
"backtick",
51+
{
52+
"avoidEscape": true
53+
}
54+
],
4755
"@typescript-eslint/prefer-interface": 0,
4856
"@typescript-eslint/explicit-function-return-type": 0,
4957
"@typescript-eslint/no-use-before-define": 0,
@@ -83,13 +91,6 @@ module.exports = {
8391
],
8492
"react-hooks/rules-of-hooks": "error",
8593
"react-hooks/exhaustive-deps": "warn",
86-
quotes: [
87-
2,
88-
"backtick",
89-
{
90-
"avoidEscape": true
91-
}
92-
],
9394
indent: ["error", 2, { SwitchCase: 1 }],
9495
"prettier/prettier": [
9596
"error",

themes/gatsby-theme-cara/src/components/svg.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ const icons = {
6767
},
6868
}
6969

70-
// TODO: https://github.com/typescript-eslint/typescript-eslint/pull/762 Change quotes setup so that type can also use double quotes
71-
// eslint-disable-next-line
7270
type IconType = "triangle" | "circle" | "arrowUp" | "upDown" | "box" | "hexa" | "cross"
7371

7472
type SVGProps = {

themes/gatsby-theme-specimens/src/components/alert.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import Announcement from "../icons/announcement"
77
import Info from "../icons/info"
88
import Important from "../icons/important"
99

10-
// TODO: https://github.com/typescript-eslint/typescript-eslint/pull/762 Change quotes setup so that type can also use double quotes
11-
// eslint-disable-next-line
12-
type AlertTypes = 'success' | 'hint' | 'warning' | 'info' | 'danger'
10+
type AlertTypes = "success" | "hint" | "warning" | "info" | "danger"
1311

1412
type AlertProps = {
1513
children: React.ReactNode

themes/gatsby-theme-specimens/src/components/palette.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import ColorRow from "./color-row"
66

77
const join = (...args: any) => args.filter(Boolean).join(`.`)
88

9-
// TODO: https://github.com/typescript-eslint/typescript-eslint/pull/762 Change quotes setup so that type can also use double quotes
10-
// eslint-disable-next-line
11-
type ModeTypes = 'list' | 'swatch'
9+
type ModeTypes = "list" | "swatch"
1210

1311
type PaletteProps = {
1412
colors: {

themes/gatsby-theme-specimens/src/hooks/useSpecimensConfig.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { useStaticQuery, graphql } from "gatsby"
22

3-
// TODO: https://github.com/typescript-eslint/typescript-eslint/pull/762 Change quotes setup so that type can also use double quotes
4-
// eslint-disable-next-line
5-
type ContrastTypes = 'AA' | 'AAA'
3+
type ContrastTypes = "AA" | "AAA"
64

75
type specimensOptionsType = {
86
specimensConfig: {

0 commit comments

Comments
 (0)