Skip to content

Commit

Permalink
chore: Update eslint „quotes“ rule
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
LekoArts committed Sep 11, 2019
1 parent 796180c commit e9e75cb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
15 changes: 8 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ module.exports = {
"allowTaggedTemplates": true
}
],
quotes: "off",
"@typescript-eslint/quotes": [
2,
"backtick",
{
"avoidEscape": true
}
],
"@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-use-before-define": 0,
Expand Down Expand Up @@ -83,13 +91,6 @@ module.exports = {
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
quotes: [
2,
"backtick",
{
"avoidEscape": true
}
],
indent: ["error", 2, { SwitchCase: 1 }],
"prettier/prettier": [
"error",
Expand Down
2 changes: 0 additions & 2 deletions themes/gatsby-theme-cara/src/components/svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ const icons = {
},
}

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

type SVGProps = {
Expand Down
4 changes: 1 addition & 3 deletions themes/gatsby-theme-specimens/src/components/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import Announcement from "../icons/announcement"
import Info from "../icons/info"
import Important from "../icons/important"

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

type AlertProps = {
children: React.ReactNode
Expand Down
4 changes: 1 addition & 3 deletions themes/gatsby-theme-specimens/src/components/palette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import ColorRow from "./color-row"

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

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

type PaletteProps = {
colors: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { useStaticQuery, graphql } from "gatsby"

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

type specimensOptionsType = {
specimensConfig: {
Expand Down

0 comments on commit e9e75cb

Please sign in to comment.