| @@ -0,0 +1,32 @@ | ||
| --- | ||
| name: "\U0001F4DD Non-rule change request" | ||
| about: Request a change that is not a bug fix, rule change, or new rule | ||
| title: '' | ||
| labels: enhancement, triage, core | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| <!-- | ||
| ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). | ||
| This template is for requesting a change that is not a bug fix, rule change, or new rule. If you are here for another reason, please see below: | ||
| 1. To report a bug: https://eslint.org/docs/developer-guide/contributing/reporting-bugs | ||
| 2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes | ||
| 3. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules | ||
| 4. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint | ||
| Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue. | ||
| --> | ||
|
|
||
| **The version of ESLint you are using.** | ||
|
|
||
|
|
||
| **The problem you want to solve.** | ||
|
|
||
|
|
||
| **Your take on the correct solution to problem.** | ||
|
|
||
|
|
||
| **Are you willing to submit a pull request to implement this change?** |
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| name: "\U0001F680 New rule proposal" | ||
| about: Propose a new rule to be added to ESLint | ||
| title: '' | ||
| labels: triage, rule, feature | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| <!-- | ||
| ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). | ||
| This template is for new rule proposals. If you are proposing a new rule, please continue on. If you are here for another reason, please see below: | ||
| 1. To report a bug: https://eslint.org/docs/developer-guide/contributing/reporting-bugs | ||
| 2. To request a rule change: https://eslint.org/docs/developer-guide/contributing/rule-changes | ||
| 3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes | ||
| 4. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint | ||
| Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue. | ||
| --> | ||
|
|
||
| **Please describe what the rule should do:** | ||
|
|
||
| **What category of rule is this? (place an "X" next to just one item)** | ||
|
|
||
| [ ] Warns about a potential error (problem) | ||
| [ ] Suggests an alternate way of doing something (suggestion) | ||
| [ ] Enforces code style (layout) | ||
| [ ] Other (please specify:) | ||
|
|
||
| **Provide 2-3 code examples that this rule will warn about:** | ||
|
|
||
| <!-- Put your code examples here --> | ||
| ```js | ||
| ``` | ||
|
|
||
| **Why should this rule be included in ESLint (instead of a plugin)?** | ||
|
|
||
|
|
||
| **Are you willing to submit a pull request to implement this rule?** |
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: "â›” Question" | ||
| about: Please go to https://gitter.im/eslint/eslint | ||
| title: '' | ||
| labels: '' | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| <!-- | ||
| ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). | ||
| Please do not use GitHub for asking questions. Instead, | ||
| please visit our chatroom: | ||
| https://gitter.im/eslint/eslint | ||
| Or our mailing list: | ||
| https://groups.google.com/group/eslint | ||
| Thanks in advance for helping us keep the issue tracker | ||
| clean! | ||
| --> |
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| name: "\U0001F4DD Rule change request" | ||
| about: Request a change to an existing rule | ||
| title: '' | ||
| labels: enhancement, triage, rule | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| <!-- | ||
| ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). | ||
| This template is for requesting a rule change. If you are here for another reason, please see below: | ||
| 1. To report a bug: https://eslint.org/docs/developer-guide/contributing/reporting-bugs | ||
| 2. To propose a new rule: https://eslint.org/docs/developer-guide/contributing/new-rules | ||
| 3. To request a change that is not a bug fix, rule change, or new rule: https://eslint.org/docs/developer-guide/contributing/changes | ||
| 4. If you have any questions, please stop by our chatroom: https://gitter.im/eslint/eslint | ||
| Note that leaving sections blank will make it difficult for us to troubleshoot and we may have to close the issue. | ||
| --> | ||
|
|
||
| **What rule do you want to change?** | ||
|
|
||
| **Does this change cause the rule to produce more or fewer warnings?** | ||
|
|
||
| **How will the change be implemented? (New option, new default behavior, etc.)?** | ||
|
|
||
| **Please provide some example code that this change will affect:** | ||
|
|
||
| <!-- Put your code examples here --> | ||
| ```js | ||
| ``` | ||
|
|
||
| **What does the rule currently do for this code?** | ||
|
|
||
| **What will the rule do after it's changed?** | ||
|
|
||
| **Are you willing to submit a pull request to implement this change?** |
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| name: "â›” Security issue" | ||
| about: Please file security issues at https://hackerone.com/eslint | ||
| title: '' | ||
| labels: '' | ||
| assignees: '' | ||
|
|
||
| --- | ||
|
|
||
| <!-- | ||
| ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). | ||
| STOP! Please do not use GitHub for filing security issues. | ||
| Doing so is insecure and may put other ESLint users at risk. | ||
| To securely notify us of a security issue, please go to: | ||
| https://hackerone.com/eslint | ||
| Thanks in advance for helping us keep the ESLint community | ||
| safe and secure. | ||
| --> |
| @@ -0,0 +1,63 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| verify_files: | ||
| name: Verify Files | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/setup-node@v1 | ||
| - name: Install Packages | ||
| run: npm install | ||
| - name: Lint Files | ||
| run: node Makefile lint | ||
| - name: Check Rule Files | ||
| run: node Makefile checkRuleFiles | ||
| - name: Check Licenses | ||
| run: node Makefile checkLicenses | ||
|
|
||
| test_on_node: | ||
| name: Test | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macOS-latest] | ||
| node: [8.x, 10.x, 12.x] | ||
| exclude: | ||
| - os: windows-latest | ||
| node: 8.x | ||
| - os: windows-latest | ||
| node: 10.x | ||
| - os: macOS-latest | ||
| node: 8.x | ||
| - os: macOS-latest | ||
| node: 10.x | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| - name: Install Packages | ||
| run: npm install | ||
| - name: Test | ||
| run: node Makefile mocha | ||
| - name: Fuzz Test | ||
| run: node Makefile fuzz | ||
|
|
||
| test_on_browser: | ||
| name: Browser Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/setup-node@v1 | ||
| - name: Install Packages | ||
| run: npm install | ||
| - name: Test | ||
| run: node Makefile karma | ||
| - name: Fuzz Test | ||
| run: node Makefile fuzz |
| @@ -0,0 +1,21 @@ | ||
| default: true | ||
|
|
||
| # Exclusions for deliberate/widespread violations | ||
| MD001: false # Header levels should only increment by one level at a time | ||
| MD002: false # First header should be a h1 header | ||
| MD007: # Unordered list indentation | ||
| indent: 4 | ||
| MD012: false # Multiple consecutive blank lines | ||
| MD013: false # Line length | ||
| MD014: false # Dollar signs used before commands without showing output | ||
| MD019: false # Multiple spaces after hash on atx style header | ||
| MD021: false # Multiple spaces inside hashes on closed atx style header | ||
| MD024: false # Multiple headers with the same content | ||
| MD026: false # Trailing punctuation in header | ||
| MD029: false # Ordered list item prefix | ||
| MD030: false # Spaces after list markers | ||
| MD033: false # Allow inline HTML | ||
| MD034: false # Bare URL used | ||
| MD040: false # Fenced code blocks should have a language specified | ||
| MD041: false # First line in file should be a top level header | ||
| MD046: false # Code block style |
| @@ -0,0 +1 @@ | ||
| package-lock = false |
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "include": [ | ||
| "bin/**/*.js", | ||
| "conf/**/*.js", | ||
| "lib/**/*.js" | ||
| ], | ||
| "reporter": [ | ||
| "lcov", | ||
| "text-summary", | ||
| "cobertura" | ||
| ], | ||
| "sourceMap": true | ||
| } |
| @@ -0,0 +1 @@ | ||
| This project adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct). |
| @@ -0,0 +1 @@ | ||
| If you have a question about how to use ESLint, please ask it in our [Gitter channel](https://gitter.im/eslint/eslint). |
| @@ -0,0 +1,38 @@ | ||
| trigger: | ||
| - master | ||
|
|
||
| jobs: | ||
| - template: .azure-pipelines/job.yml | ||
| parameters: | ||
| name: test_on_linux_node12 | ||
| displayName: Test on Node.js 12 (Linux) | ||
| vmImage: Ubuntu-16.04 | ||
| nodeVersion: 12.x | ||
|
|
||
| - template: .azure-pipelines/job.yml | ||
| parameters: | ||
| name: test_on_linux_node10 | ||
| displayName: Test on Node.js 10 (Linux) | ||
| vmImage: Ubuntu-16.04 | ||
| nodeVersion: 10.x | ||
|
|
||
| - template: .azure-pipelines/job.yml | ||
| parameters: | ||
| name: test_on_linux_node8 | ||
| displayName: Test on Node.js 8 (Linux) | ||
| vmImage: Ubuntu-16.04 | ||
| nodeVersion: 8.x | ||
|
|
||
| - template: .azure-pipelines/job.yml | ||
| parameters: | ||
| name: test_on_windows_node12 | ||
| displayName: Test on Node.js 12 (Windows) | ||
| vmImage: Windows-2019 | ||
| nodeVersion: 12.x | ||
|
|
||
| - template: .azure-pipelines/job.yml | ||
| parameters: | ||
| name: test_on_macos_node12 | ||
| displayName: Test on Node.js 12 (macOS) | ||
| vmImage: macOS-10.14 | ||
| nodeVersion: 12.x |
| @@ -0,0 +1,79 @@ | ||
| /** | ||
| * @fileoverview Defines a schema for configs. | ||
| * @author Sylvan Mably | ||
| */ | ||
|
|
||
| "use strict"; | ||
|
|
||
| const baseConfigProperties = { | ||
| env: { type: "object" }, | ||
| extends: { $ref: "#/definitions/stringOrStrings" }, | ||
| globals: { type: "object" }, | ||
| overrides: { | ||
| type: "array", | ||
| items: { $ref: "#/definitions/overrideConfig" }, | ||
| additionalItems: false | ||
| }, | ||
| parser: { type: ["string", "null"] }, | ||
| parserOptions: { type: "object" }, | ||
| plugins: { type: "array" }, | ||
| processor: { type: "string" }, | ||
| rules: { type: "object" }, | ||
| settings: { type: "object" }, | ||
| noInlineConfig: { type: "boolean" }, | ||
| reportUnusedDisableDirectives: { type: "boolean" }, | ||
|
|
||
| ecmaFeatures: { type: "object" } // deprecated; logs a warning when used | ||
| }; | ||
|
|
||
| const configSchema = { | ||
| definitions: { | ||
| stringOrStrings: { | ||
| oneOf: [ | ||
| { type: "string" }, | ||
| { | ||
| type: "array", | ||
| items: { type: "string" }, | ||
| additionalItems: false | ||
| } | ||
| ] | ||
| }, | ||
| stringOrStringsRequired: { | ||
| oneOf: [ | ||
| { type: "string" }, | ||
| { | ||
| type: "array", | ||
| items: { type: "string" }, | ||
| additionalItems: false, | ||
| minItems: 1 | ||
| } | ||
| ] | ||
| }, | ||
|
|
||
| // Config at top-level. | ||
| objectConfig: { | ||
| type: "object", | ||
| properties: { | ||
| root: { type: "boolean" }, | ||
| ...baseConfigProperties | ||
| }, | ||
| additionalProperties: false | ||
| }, | ||
|
|
||
| // Config in `overrides`. | ||
| overrideConfig: { | ||
| type: "object", | ||
| properties: { | ||
| excludedFiles: { $ref: "#/definitions/stringOrStrings" }, | ||
| files: { $ref: "#/definitions/stringOrStringsRequired" }, | ||
| ...baseConfigProperties | ||
| }, | ||
| required: ["files"], | ||
| additionalProperties: false | ||
| } | ||
| }, | ||
|
|
||
| $ref: "#/definitions/objectConfig" | ||
| }; | ||
|
|
||
| module.exports = configSchema; |
| @@ -0,0 +1,17 @@ | ||
| # Documentation | ||
|
|
||
| Welcome to our documentation pages! What would you like to view? | ||
|
|
||
| ## [User Guide](user-guide) | ||
|
|
||
| Intended for end users of ESLint. Contains information about core rules, configuration, command line options, formatters, and integrations, | ||
| as well as guides for migrating from earlier versions of ESLint. | ||
|
|
||
| ## [Developer Guide](developer-guide) | ||
|
|
||
| Intended for contributors to ESLint and people who wish to extend ESLint. Contains information about contributing to ESLint; creating custom | ||
| rules, configurations, plugins, and formatters; and information about our architecture and Node.js API. | ||
|
|
||
| ## [Maintainer Guide](maintainer-guide) | ||
|
|
||
| Intended for maintainers of ESLint. |
| @@ -0,0 +1,386 @@ | ||
| # ScopeManager | ||
|
|
||
| This document was written based on the implementation of [eslint-scope](https://github.com/eslint/eslint-scope), a fork of [escope](https://github.com/estools/escope), and deprecates some members ESLint is not using. | ||
|
|
||
| ---- | ||
|
|
||
| ## ScopeManager interface | ||
|
|
||
| `ScopeManager` object has all variable scopes. | ||
|
|
||
| ### Fields | ||
|
|
||
| #### scopes | ||
|
|
||
| * **Type:** `Scope[]` | ||
| * **Description:** All scopes. | ||
|
|
||
| #### globalScope | ||
|
|
||
| * **Type:** `Scope` | ||
| * **Description:** The root scope. | ||
|
|
||
| ### Methods | ||
|
|
||
| #### acquire(node, inner = false) | ||
|
|
||
| * **Parameters:** | ||
| * `node` (`ASTNode`) ... An AST node to get their scope. | ||
| * `inner` (`boolean`) ... If the node has multiple scope, this returns the outermost scope normally. If `inner` is `true` then this returns the innermost scope. Default is `false`. | ||
| * **Return type:** `Scope | null` | ||
| * **Description:** Get the scope of a given AST node. The gotten scope's `block` property is the node. This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`. | ||
|
|
||
| #### getDeclaredVariables(node) | ||
|
|
||
| * **Parameters:** | ||
| * `node` (`ASTNode`) ... An AST node to get their variables. | ||
| * **Return type:** `Variable[]` | ||
| * **Description:** Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. If the node does not define any variable, this returns an empty array. | ||
|
|
||
| ### Deprecated members | ||
|
|
||
| Those members are defined but not used in ESLint. | ||
|
|
||
| #### isModule() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this program is module. | ||
|
|
||
| #### isImpliedStrict() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this program is strict mode implicitly. I.e., `options.impliedStrict === true`. | ||
|
|
||
| #### isStrictModeSupported() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this program supports strict mode. I.e., `options.ecmaVersion >= 5`. | ||
|
|
||
| #### acquireAll(node) | ||
|
|
||
| * **Parameters:** | ||
| * `node` (`ASTNode`) ... An AST node to get their scope. | ||
| * **Return type:** `Scope[] | null` | ||
| * **Description:** Get the scopes of a given AST node. The gotten scopes' `block` property is the node. If the node does not have their scope, this returns `null`. | ||
|
|
||
| ---- | ||
|
|
||
| ## Scope interface | ||
|
|
||
| `Scope` object has all variables and references in the scope. | ||
|
|
||
| ### Fields | ||
|
|
||
| #### type | ||
|
|
||
| * **Type:** `string` | ||
| * **Description:** The type of this scope. This is one of `"block"`, `"catch"`, `"class"`, `"for"`, `"function"`, `"function-expression-name"`, `"global"`, `"module"`, `"switch"`, `"with"` | ||
|
|
||
| #### isStrict | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this scope is strict mode. | ||
|
|
||
| #### upper | ||
|
|
||
| * **Type:** `Scope | null` | ||
| * **Description:** The parent scope. If this is the global scope then this property is `null`. | ||
|
|
||
| #### childScopes | ||
|
|
||
| * **Type:** `Scope[]` | ||
| * **Description:** The array of child scopes. This does not include grandchild scopes. | ||
|
|
||
| #### variableScope | ||
|
|
||
| * **Type:** `Scope` | ||
| * **Description:** The scope which hosts variables which are defined by `var` declarations. | ||
|
|
||
| #### block | ||
|
|
||
| * **Type:** `ASTNode` | ||
| * **Description:** The AST node which created this scope. | ||
|
|
||
| #### variables | ||
|
|
||
| * **Type:** `Variable[]` | ||
| * **Description:** The array of all variables which are defined on this scope. This does not include variables which are defined in child scopes. | ||
|
|
||
| #### set | ||
|
|
||
| * **Type:** `Map<string, Variable>` | ||
| * **Description:** The map from variable names to variable objects. | ||
|
|
||
| > I hope to rename `set` field or replace by a method. | ||
| #### references | ||
|
|
||
| * **Type:** `Reference[]` | ||
| * **Description:** The array of all references on this scope. This does not include references in child scopes. | ||
|
|
||
| #### through | ||
|
|
||
| * **Type:** `Reference[]` | ||
| * **Description:** The array of references which could not be resolved in this scope. | ||
|
|
||
| #### functionExpressionScope | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this scope is `"function-expression-name"` scope. | ||
|
|
||
| > I hope to deprecate `functionExpressionScope` field as replacing by `scope.type === "function-expression-name"`. | ||
| ### Deprecated members | ||
|
|
||
| Those members are defined but not used in ESLint. | ||
|
|
||
| #### taints | ||
|
|
||
| * **Type:** `Map<string, boolean>` | ||
| * **Description:** The map from variable names to `tainted` flag. | ||
|
|
||
| #### dynamic | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this scope is dynamic. I.e., the type of this scope is `"global"` or `"with"`. | ||
|
|
||
| #### directCallToEvalScope | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this scope contains `eval()` invocations. | ||
|
|
||
| #### thisFound | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this scope contains `this`. | ||
|
|
||
| #### resolve(node) | ||
|
|
||
| * **Parameters:** | ||
| * `node` (`ASTNode`) ... An AST node to get their reference object. The type of the node must be `"Identifier"`. | ||
| * **Return type:** `Reference | null` | ||
| * **Description:** Returns `this.references.find(r => r.identifier === node)`. | ||
|
|
||
| #### isStatic() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** Returns `!this.dynamic`. | ||
|
|
||
| #### isArgumentsMaterialized() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this is a `"function"` scope which has used `arguments` variable. | ||
|
|
||
| #### isThisMaterialized() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** Returns `this.thisFound`. | ||
|
|
||
| #### isUsedName(name) | ||
|
|
||
| * **Parameters:** | ||
| * `name` (`string`) ... The name to check. | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if a given name is used in variable names or reference names. | ||
|
|
||
| ---- | ||
|
|
||
| ## Variable interface | ||
|
|
||
| `Variable` object is variable's information. | ||
|
|
||
| ### Fields | ||
|
|
||
| #### name | ||
|
|
||
| * **Type:** `string` | ||
| * **Description:** The name of this variable. | ||
|
|
||
| #### identifiers | ||
|
|
||
| * **Type:** `ASTNode[]` | ||
| * **Description:** The array of `Identifier` nodes which define this variable. If this variable is redeclared, this array includes two or more nodes. | ||
|
|
||
| > I hope to deprecate `identifiers` field as replacing by `defs[].name` field. | ||
| #### references | ||
|
|
||
| * **Type:** `Reference[]` | ||
| * **Description:** The array of the references of this variable. | ||
|
|
||
| #### defs | ||
|
|
||
| * **Type:** `Definition[]` | ||
| * **Description:** The array of the definitions of this variable. | ||
|
|
||
| ### Deprecated members | ||
|
|
||
| Those members are defined but not used in ESLint. | ||
|
|
||
| #### tainted | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** The `tainted` flag. (always `false`) | ||
|
|
||
| #### stack | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** The `stack` flag. (I'm not sure what this means.) | ||
|
|
||
| ---- | ||
|
|
||
| ## Reference interface | ||
|
|
||
| `Reference` object is reference's information. | ||
|
|
||
| ### Fields | ||
|
|
||
| #### identifier | ||
|
|
||
| * **Type:** `ASTNode` | ||
| * **Description:** The `Identifier` node of this reference. | ||
|
|
||
| #### from | ||
|
|
||
| * **Type:** `Scope` | ||
| * **Description:** The `Scope` object that this reference is on. | ||
|
|
||
| #### resolved | ||
|
|
||
| * **Type:** `Variable | null` | ||
| * **Description:** The `Variable` object that this reference refers. If such variable was not defined, this is `null`. | ||
|
|
||
| #### writeExpr | ||
|
|
||
| * **Type:** `ASTNode | null` | ||
| * **Description:** The ASTNode object which is right-hand side. | ||
|
|
||
| #### init | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** `true` if this writing reference is a variable initializer or a default value. | ||
|
|
||
| ### Methods | ||
|
|
||
| #### isWrite() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is writing. | ||
|
|
||
| #### isRead() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is reading. | ||
|
|
||
| #### isWriteOnly() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is writing but not reading. | ||
|
|
||
| #### isReadOnly() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is reading but not writing. | ||
|
|
||
| #### isReadWrite() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is reading and writing. | ||
|
|
||
| ### Deprecated members | ||
|
|
||
| Those members are defined but not used in ESLint. | ||
|
|
||
| #### tainted | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** The `tainted` flag. (always `false`) | ||
|
|
||
| #### flag | ||
|
|
||
| * **Type:** `number` | ||
| * **Description:** `1` is reading, `2` is writing, `3` is reading/writing. | ||
|
|
||
| #### partial | ||
|
|
||
| * **Type:** `boolean` | ||
| * **Description:** The `partial` flag. | ||
|
|
||
| #### isStatic() | ||
|
|
||
| * **Parameters:** | ||
| * **Return type:** `boolean` | ||
| * **Description:** `true` if this reference is resolved statically. | ||
|
|
||
| ---- | ||
|
|
||
| ## Definition interface | ||
|
|
||
| `Definition` object is variable definition's information. | ||
|
|
||
| ### Fields | ||
|
|
||
| #### type | ||
|
|
||
| * **Type:** `string` | ||
| * **Description:** The type of this definition. One of `"CatchClause"`, `"ClassName"`, `"FunctionName"`, `"ImplicitGlobalVariable"`, `"ImportBinding"`, `"Parameter"`, and `"Variable"`. | ||
|
|
||
| #### name | ||
|
|
||
| * **Type:** `ASTNode` | ||
| * **Description:** The `Identifier` node of this definition. | ||
|
|
||
| #### node | ||
|
|
||
| * **Type:** `ASTNode` | ||
| * **Description:** The enclosing node of the name. | ||
|
|
||
| | type | node | | ||
| |:---------------------------|:-----| | ||
| | `"CatchClause"` | `CatchClause` | ||
| | `"ClassName"` | `ClassDeclaration` or `ClassExpression` | ||
| | `"FunctionName"` | `FunctionDeclaration` or `FunctionExpression` | ||
| | `"ImplicitGlobalVariable"` | `Program` | ||
| | `"ImportBinding"` | `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier` | ||
| | `"Parameter"` | `FunctionDeclaration`, `FunctionExpression`, or `ArrowFunctionExpression` | ||
| | `"Variable"` | `VariableDeclarator` | ||
|
|
||
| #### parent | ||
|
|
||
| * **Type:** `ASTNode | undefined | null` | ||
| * **Description:** The enclosing statement node of the name. | ||
|
|
||
| | type | parent | | ||
| |:---------------------------|:-------| | ||
| | `"CatchClause"` | `null` | ||
| | `"ClassName"` | `null` | ||
| | `"FunctionName"` | `null` | ||
| | `"ImplicitGlobalVariable"` | `null` | ||
| | `"ImportBinding"` | `ImportDeclaration` | ||
| | `"Parameter"` | `null` | ||
| | `"Variable"` | `VariableDeclaration` | ||
|
|
||
| ### Deprecated members | ||
|
|
||
| Those members are defined but not used in ESLint. | ||
|
|
||
| #### index | ||
|
|
||
| * **Type:** `number | undefined | null` | ||
| * **Description:** The index in the declaration statement. | ||
|
|
||
| #### kind | ||
|
|
||
| * **Type:** `string | undefined | null` | ||
| * **Description:** The kind of the declaration statement. |