eslint-config-sanity

7.1.4 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.133.0-vega.cb3cdeee0vega
0.133.0-babel-7.06032ac51babel-7
1.150.5-canary.60canary
1.148.5-document-actions.230document-actions
0.147.10-next.230next
0.147.0-handle-access-control-errors.380handle-access-control-errors
0.147.0-block-tools-white-space-fix.20block-tools-white-space-fix
0.147.0-alpha.20asset-sources
0.144.4-cheesy-bites.1210cheesy-bites
0.140.0-alpha.40realtime-block-editor
0.136.3-gql-rtb.4170gql-rtb
0.136.1-canary.660graphql
0.134.0-alpha.d19d4c0c0structure
7.1.4
935latest
1.150.9-review-changes.10241review-changes
0.147.10-ts-client.11ts-client
0.146.4-hints-mode.1561hints-mode
0.143.0-initial-value-templates.551initial-value-templates
0.139.3-parrot.01alpha

Version History

VersionDownloads (Last 7 Days)Published
7.1.4
935
7.1.3
2,251
7.1.2
1,103
7.1.1
8
7.1.0
1
7.0.3
1
7.0.2
2
7.0.1
132
7.0.0
2
6.0.0539
5.1.0581
5.0.01
1.150.9-review-changes.10241
1.150.9-review-changes.9520
1.150.9-review-changes.9120
1.150.9-review-changes.8771
1.150.9-review-changes.7360
1.150.823
1.150.8-review-changes.6440
1.150.8-review-changes.4630
1.150.8-review-changes.3820
1.150.8-review-changes.3790
1.150.8-review-changes.3751
1.150.5-canary.60
1.150.2-canary.00
1.150.12
1.150.01
1.149.20-canary.4880
1.149.20-canary.4870
1.149.20-canary.4860
1.149.20-canary.4690
1.149.20-canary.4631
1.149.20-canary.4620
1.149.20-canary.4611
1.149.20-canary.4601
1.149.18-canary.4450
1.149.181
1.149.18-canary.4230
1.149.18-canary.4220
1.149.18-canary.4210
1.149.18-canary.4190
1.149.18-canary.4150
1.149.16-canary.4400
1.149.16-canary.4390
1.149.16-canary.4381
1.149.16-canary.4370
1.149.16-canary.4120
1.149.16-canary.3790
1.149.162
1.149.16-canary.2500
1.149.16-canary.2230
1.149.16-canary.2021
1.149.16-canary.2010
1.149.16-canary.1361
1.149.16-canary.350
1.149.131
1.149.02
1.148.5-document-actions.230
1.148.3-document-actions.260
1.148.3-document-actions.160
1.148.12
1.148.01
0.147.10-next.230
0.147.10-document-actions.370
0.147.10-document-actions.341
0.147.10-document-actions.310
0.147.10-document-actions.300
0.147.10-document-actions.970
0.147.10-ts-client.11
0.147.10-document-actions.840
0.147.8-canary.180
0.147.8-document-actions.860
0.147.8-document-actions.590
0.147.7-document-actions.590
0.147.7-document-actions.520
0.147.7-document-actions.510
0.147.7-document-actions.500
0.147.01
0.147.0-handle-access-control-errors.380
0.146.4-hints-mode.1561
0.147.0-block-tools-white-space-fix.20
0.147.0-alpha.20
0.147.0-alpha.10
0.147.0-alpha.01
0.146.01
0.146.0-alpha.20
0.146.0-alpha.11
0.145.01
0.144.4-cheesy-bites.1210
0.144.4-cheesy-bites.1320
0.144.3-cheesy-bites.1100
0.144.3-cheesy-bites.1061
0.144.3-cheesy-bites.940
0.144.3-cheesy-bites.840
0.145.0-alpha.321
0.144.3-cheesy-bites.800
0.144.01
0.143.0-initial-value-templates.551
0.143.0-initial-value-templates.731
0.143.0-initial-value-templates.720
0.142.9-initial-value-templates.600
0.142.8-initial-value-templates.640
0.142.8-initial-value-templates.590
0.142.8-initial-value-templates.550
0.142.8-initial-value-templates.450
0.142.8-initial-value-templates.410
0.142.61
0.142.01
0.141.7-next.200
0.141.7-next.190
0.141.7-next.180
0.141.51
0.141.41
0.141.31
0.141.11
0.141.01
0.140.10-canary.851
0.140.10-canary.820
0.140.10-alpha.800
0.141.0-alpha.121
0.140.04
0.139.3-parrot.01
0.139.3-canary.00
0.140.0-alpha.40
0.140.0-alpha.30
0.140.0-alpha.10
0.139.01
0.139.0-rc.00
0.138.01
0.138.0-alpha.211
0.138.0-realtime-block-editor.221
0.138.0-realtime-block-editor.250
0.138.0-realtime-block-editor.240
0.138.0-realtime-block-editor.211
0.138.0-alpha.200
0.138.0-alpha.140
0.138.0-realtime-block-editor.140
0.138.0-realtime-block-editor.160
0.136.1-canary.660
0.137.01
0.136.3-gql-rtb.4170
0.137.0-realtime-block-editor.3820
0.137.0-realtime-block-editor.3800
0.137.0-realtime-block-editor.3791
0.137.0-realtime-block-editor.3780
0.137.0-realtime-block-editor.3730
0.137.0-realtime-block-editor.3720
0.136.3-gql-rtb.3750
0.136.3-gql-rtb.3720
0.136.3-gql-rtb.3710
0.136.1-canary.330
0.136.3-gql-rtb.3590
0.137.0-realtime-block-editor.3441
0.137.0-alpha.3430
0.136.1-canary.320
0.136.1-canary.280
0.136.1-canary.270
0.136.1-canary.260
0.137.0-realtime-block-editor.3430
0.137.0-realtime-block-editor.3400
0.137.0-realtime-block-editor.3260
0.137.0-realtime-block-editor.3211
0.137.0-realtime-block-editor.3191
0.137.0-realtime-block-editor.3150
0.136.1-canary.50
0.136.01
0.135.7-canary.2670
0.135.7-canary.2660
0.135.7-canary.2621
0.135.7-canary.2590
0.135.7-canary.2521
0.135.7-canary.2450
0.135.7-canary.2410
0.135.6-canary.2170
0.135.6-canary.2090
0.135.3-next.60
0.135.01
0.135.0-next.21
0.135.0-scroll-issue.60
0.135.0-next.11
0.135.0-realtime-block-editor.2500
0.135.0-realtime-block-editor.2370
0.135.0-beta.01
0.135.0-realtime-block-editor.2200
0.134.01
0.134.0-alpha.d19d4c0c0
0.134.0-beta.cddc81210
0.133.24
0.133.11
0.133.01
0.133.0-realtime-block-editor.6916e3ac1
0.133.0-alpha.620060801
0.133.0-realtime-block-editor.b65ceaaa1
0.133.0-realtime-block-editor.3566387d0
0.133.0-babel-7.06032ac51
0.133.0-babel-7.fc481eec0
0.133.0-babel-7.c9b85eeb1
0.133.0-next.0119dcd91
0.133.0-next.9c72956b0
0.133.0-alpha.6c26291e0
0.133.0-alpha.2998219b1
0.133.0-realtime-block-editor.9839d7be1
0.133.0-vega.cb3cdeee0
0.133.0-realtime-block-editor.6a0cdbe81
0.132.51
0.133.0-realtime-block-editor.5fcc290f0
0.133.0-realtime-block-editor.33c2edde0
0.133.0-realtime-block-editor.6334c0430
0.133.0-realtime-block-editor.6696d11c0
0.133.0-realtime-block-editor.410b182f2
0.133.0-realtime-block-editor.e0a05fd02
0.133.0-realtime-block-editor.8efe50ed2
0.133.0-realtime-block-editor.b0c022552
0.133.0-realtime-block-editor.72c3aa982
0.132.4-next.02
0.132.24
0.133.0-next.0fc5a66d2
0.133.0-next.ddda7af63
0.132.05
0.132.0-alpha.7fcf9a390
0.132.0-next.d060f6dc0
0.132.0-next.d3b8c54c0
0.132.0-next.f8f265d41
0.131.0-alpha.7b4bcb141
0.130.0-alpha.7e3ea3ad1
0.130.0-realtime-block-editor.e92854370
0.129.0-realtime-block-editor.3bcf64730
0.129.0-alpha.298b96b50
0.128.51
0.128.32
0.128.11
0.128.0-next.3c762f830
0.128.0-next.124ce2310
0.127.11
0.127.0-next.2eed79ff0
0.127.0-next.39c2be500
0.127.0-next.f68144931
0.126.01
0.126.0-next.536d8adf0
0.126.0-next.febffa691
4.0.23
4.0.13
4.0.01
3.1.01
3.0.11
3.0.01
2.1.420
2.1.31
2.1.23
2.1.12
2.1.01
2.0.22
2.0.11
2.0.01
1.1.41
1.1.32
1.1.21
1.0.81
1.1.12
1.0.71
1.0.61
1.0.52

Package Sidebar

Install

npm i eslint-config-sanity

Weekly Downloads

984

Version

7.1.4

License

MIT

Unpacked Size

19.8 kB

Total Files

7

Last publish

Collaborators

  • kmelve
  • bjoerge
  • rexxars
  • skogsmaskin
  • tonina
  • mattcraig
  • joneidejohnsen
  • rubioz
  • robinpyon
  • mariuslundgard
  • sanity-io
  • evenw
  • radhe_sanity
  • rbotten
  • danielsgroves
  • judofyr
  • ryanblock
  • obliadp
  • dcilke
  • madken
  • fredcarlsen
  • hermanw
  • tambet
  • sgulseth
  • atombender
  • simeonsanity
  • stipsan
  • snorreeb
  • rankers
  • rdunk
  • michael-sanity
  • vincentquigley
  • ritasdias
  • kenjonespizza
  • rneatherway-sanity
  • josh_sanity_io
  • cngonzalez-sanity
  • jjburbridge
  • tdfka_rick
  • svirs
  • ryanbonial-sanity
  • indrek.karner
  • ash
  • sergeisarviro
  • refiito
  • drewsanity
  • kaspar.lippmaa.sanity
  • dam
  • simen.svale
  • tbeseda
  • daniel.malmer
  • jordanl17
  • colepeters
  • armandocerna
  • joan_miralles_paez
  • christianhg
  • pedro-sanity
  • jwoods-sanity
  • ricokahler
  • tiit.kass.saity
  • binoy14
  • pauloborgesf
  • ausha
  • nuurtamo
  • chrislarocquesanity
  • rostimelk
  • mattlewine.sanity
  • msfragala
  • adoprog
  • tonysanity
  • mrmrs