File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,17 @@ config file:
7272}
7373```
7474
75+ ### Style
76+
77+ This plugin also exports a configuration named ` style ` , which adds some
78+ stylistic rules, such as ` prefer-to-be-null ` , which enforces usage of ` toBeNull `
79+ over ` toBe(null) ` . All rules included are:
80+
81+ - ` prefer-to-be-null `
82+ - ` prefer-to-be-undefined `
83+ - ` prefer-to-contain `
84+ - ` prefer-to-have-length `
85+
7586See
7687[ ESLint documentation] ( http://eslint.org/docs/user-guide/configuring#extending-configuration-files )
7788for more information about extending configuration files.
Original file line number Diff line number Diff line change @@ -49,6 +49,15 @@ module.exports = {
4949 'jest/valid-expect-in-promise' : 'error' ,
5050 } ,
5151 } ,
52+ style : {
53+ plugins : [ 'jest' ] ,
54+ rules : {
55+ 'jest/prefer-to-be-null' : 'error' ,
56+ 'jest/prefer-to-be-undefined' : 'error' ,
57+ 'jest/prefer-to-contain' : 'error' ,
58+ 'jest/prefer-to-have-length' : 'error' ,
59+ } ,
60+ } ,
5261 } ,
5362 environments : {
5463 globals : {
You can’t perform that action at this time.
0 commit comments