-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (37 loc) · 984 Bytes
/
index.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
/**
* Make ESLint play nice with JavaScript for Automation (JXA) code.
* @file Base ruleset.
* @author Martin Kopischke
*/
'use strict'
// Some plugins insist on manually setting globals instead of
// relying on the `env` key (e.g. Standard). Override that.
const restricted = [
'document', // added by: eslint-config-standard
'navigator', // added by: eslint-config-standard
'window' // added by: eslint-config-standard
].map(global => {
return { name: global, message: `'${global}' is not available in the JXA runtime.` }
})
module.exports = {
parserOptions: {
sourceType: 'script',
ecmaVersion: 9,
ecmaFeatures: {
globalReturn: false,
impliedStrict: false,
jsx: false
}
},
env: {
es6: true,
applescript: true,
browser: false,
node: false,
commonjs: false
},
rules: {
strict: ['warn', 'never'], // JXA ignores 'use strict' directives
'no-restricted-globals': ['error'].concat(restricted)
}
}