-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
no-process-env.js
47 lines (44 loc) · 1.07 KB
/
no-process-env.js
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
/**
* @author Vignesh Anand
* See LICENSE file in root directory for full license.
*/
"use strict"
const RuleTester = require("eslint").RuleTester
const rule = require("../../../lib/rules/no-process-env")
new RuleTester().run("no-process-env", rule, {
valid: [
"Process.env",
"process[env]",
"process.nextTick",
"process.execArgv",
],
invalid: [
{
code: "process.env",
errors: [
{
messageId: "unexpectedProcessEnv",
type: "MemberExpression",
},
],
},
{
code: "process.env.ENV",
errors: [
{
messageId: "unexpectedProcessEnv",
type: "MemberExpression",
},
],
},
{
code: "f(process.env)",
errors: [
{
messageId: "unexpectedProcessEnv",
type: "MemberExpression",
},
],
},
],
})