This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
79 lines (77 loc) · 1.92 KB
/
.eslintrc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
root: true
extends:
- semistandard
- plugin:prettier/recommended
env:
node: yes
browser: yes
parserOptions:
ecmaVersion: 5
ecmaFeatures:
globalReturn: no
jsx: no
sourceType: script
rules:
strict:
- error
- safe
overrides:
- files:
- scripts/**/*.js
- package-scripts.js
- karma.conf.js
- .wallaby.js
- .eleventy.js
- bin/*
- lib/cli/**/*.js
- test/node-unit/**/*.js
- lib/growl.js
parserOptions:
ecmaVersion: 6
env:
browser: no
- files:
- test/**/*.{js,mjs}
env:
mocha: yes
globals:
expect: no
- files:
- bin/*
- lib/**/*.js
rules:
no-restricted-globals:
- error
- name: setTimeout
message: &GH-237 See https://github.com/mochajs/mocha/issues/237
- name: clearTimeout
message: *GH-237
- name: setInterval
message: *GH-237
- name: clearInterval
message: *GH-237
- name: setImmediate
message: *GH-237
- name: clearImmediate
message: *GH-237
- name: Date
message: *GH-237
no-restricted-modules:
- error
- timers
no-restricted-syntax:
- error
# disallow `global.setTimeout()`, `global.setInterval()`, etc.
- selector: 'CallExpression[callee.object.name=global][callee.property.name=/(set|clear)(Timeout|Immediate|Interval)/]'
message: *GH-237
# disallow `new global.Date()`
- selector: 'NewExpression[callee.object.name=global][callee.property.name=Date]'
message: *GH-237
# disallow property access of `global.<timer>.*`
- selector: '*[object.object.name=global][object.property.name=/(Date|(set|clear)(Timeout|Immediate|Interval))/]:expression'
message: *GH-237
- files:
- test/**/*.mjs
parserOptions:
ecmaVersion: 6
sourceType: module