@servicenow/eslint-plugin-sdk-app-plugin 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +1,37 @@
1
1
  const { createTrackMap } = require('../util/utility')
2
2
  const { ReferenceTracker } = require('@eslint-community/eslint-utils')
3
3
 
4
+ /** @type {import('eslint').Rule.RuleModule} */
4
5
  module.exports = {
5
6
  meta: {
6
7
  docs: {
7
8
  description: 'disallow unsupported Node.js built-in APIs',
8
- recommended: true
9
+ recommended: true,
9
10
  },
10
- fixable: null,
11
11
  messages: {
12
- forbidden: 'The {{name}} Node.js API is not supported in now platform.'
12
+ forbidden: 'The {{name}} Node.js API is not supported in now platform.',
13
13
  },
14
- schema:[],
15
- type:'problem',
14
+ schema: [],
15
+ type: 'problem',
16
16
  },
17
17
  create(context) {
18
18
  return {
19
- "Program:exit"(node){
19
+ 'Program:exit'(node) {
20
20
  const sourceCode = context.sourceCode
21
21
  const tracker = new ReferenceTracker(sourceCode.getScope(node), { mode: 'legacy' })
22
22
  const trackMap = createTrackMap(false)
23
23
  const globalsTrackMap = createTrackMap(true)
24
-
24
+
25
25
  const references = [
26
26
  ...tracker.iterateCjsReferences(trackMap),
27
27
  ...tracker.iterateEsmReferences(trackMap),
28
- ...tracker.iterateGlobalReferences(globalsTrackMap)
28
+ ...tracker.iterateGlobalReferences(globalsTrackMap),
29
29
  ]
30
30
 
31
- for(const { node, info } of references) {
31
+ for (const { node, info } of references) {
32
32
  context.report({ node, messageId: 'forbidden', data: info })
33
33
  }
34
- }
34
+ },
35
35
  }
36
- }
37
- }
36
+ },
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicenow/eslint-plugin-sdk-app-plugin",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Plugin to disallow Browser and Node.js APIs not supported in rhino engine",
5
5
  "keywords": [
6
6
  "eslint",