7.1.4 • Published 1 year ago

eslint-config-sanity v7.1.4

Weekly downloads
2,628
License
MIT
Repository
github
Last release
1 year ago

eslint-config-sanity

Shared eslint rules for official Sanity.io projects

Installing

npm install --save-dev eslint-config-sanity

Usage

Create an .eslintrc in the root of your project (or an eslintConfig entry in package.json) and extend the sanity config:

{
  "env": {"node": true, "browser": true},
  "extends": ["sanity"]
}

Adjust env according to your use case, obviously.

Usage: React

ESLint requires plugins to be peer dependencies (they resolve relative to the end-user project), as such you need to install an additional dependency if you're using React:

npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks

Then, make sure to extend sanity/react in your .eslintrc:

{
  "extends": ["sanity/react"]
}

Note: It's not necessary to extend both sanity and sanity/react - extending sanity/react will implicitly extend sanity first.

Note: If you're using TypeScript and React, make sure you extend sanity/react before sanity/typescript:

{
  "extends": ["sanity/react", "sanity/typescript"]
}

Usage: Typescript

ESLint requires plugins to be peer dependencies (they resolve relative to the end-user project), as such you need to install a few more dependencies if you're using typescript:

npm install --save-dev \
  typescript \
  @typescript-eslint/parser \
  @typescript-eslint/eslint-plugin

Then, make sure to extend sanity/typescript in your .eslintrc:

{
  "extends": ["sanity/typescript"]
}

Note: It's not necessary to extend both sanity and sanity/typescript - extending sanity/typescript will implicitly extend sanity first.

Note: If you're using TypeScript and React, make sure you extend sanity/react before sanity/typescript:

{
  "extends": ["sanity/react", "sanity/typescript"]
}

License

MIT © Sanity.io

7.1.4

1 year ago

7.1.3

2 years ago

7.1.2

2 years ago

7.0.3

2 years ago

7.1.1

2 years ago

7.1.0

2 years ago

7.0.2

2 years ago

7.0.0

3 years ago

7.0.1

3 years ago

6.0.0

4 years ago

5.1.0

5 years ago

5.0.0

5 years ago

1.150.8

6 years ago

1.150.5-canary.6

6 years ago

1.150.2-canary.0

6 years ago

1.150.1

6 years ago

1.150.0

6 years ago

1.149.18

6 years ago

1.149.16

6 years ago

1.149.13

6 years ago

1.149.0

6 years ago

1.148.1

6 years ago

1.148.0

6 years ago

0.147.10-next.23

6 years ago

0.147.0

6 years ago

0.147.0-alpha.1

7 years ago

0.147.0-alpha.2

7 years ago

0.147.0-alpha.0

7 years ago

0.146.0

7 years ago

0.146.0-alpha.2

7 years ago

0.146.0-alpha.1

7 years ago

0.145.0

7 years ago

0.145.0-alpha.32

7 years ago

0.144.0

7 years ago

0.142.6

7 years ago

0.142.0

7 years ago

0.141.7-next.20

7 years ago

0.141.7-next.19

7 years ago

0.141.7-next.18

7 years ago

0.141.5

7 years ago

0.141.4

7 years ago

0.141.3

7 years ago

0.141.1

7 years ago

0.141.0

7 years ago

0.141.0-alpha.12

7 years ago

0.140.0

7 years ago

0.139.3-parrot.0

7 years ago

0.139.3-canary.0

7 years ago

0.140.0-alpha.4

7 years ago

0.140.0-alpha.3

7 years ago

0.140.0-alpha.1

7 years ago

0.139.0

7 years ago

0.139.0-rc.0

7 years ago

0.138.0

7 years ago

0.138.0-alpha.21

7 years ago

0.138.0-alpha.20

7 years ago

0.138.0-alpha.14

7 years ago

0.137.0

7 years ago

0.136.1-canary.5

8 years ago

0.136.0

8 years ago

0.135.3-next.6

8 years ago

0.135.0

8 years ago

0.135.0-next.2

8 years ago

0.135.0-next.1

8 years ago

0.135.0-beta.0

8 years ago

0.134.0

8 years ago

0.133.2

8 years ago

0.133.1

8 years ago

0.133.0

8 years ago

0.132.5

8 years ago

0.132.4-next.0

8 years ago

0.132.2

8 years ago

0.132.0

8 years ago

0.128.5

8 years ago

0.128.3

8 years ago

0.128.1

8 years ago

0.127.1

8 years ago

0.126.0

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

4.0.0

8 years ago

3.1.0

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.1.4

9 years ago

2.1.3

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.2

9 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.0.8

10 years ago

1.1.1

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago